Skip to content

Commit 5b87284

Browse files
test(web): a side chat hidden in its parent's panel still toasts
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 6dd082e commit 5b87284

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎apps/web/src/components/ThreadNotificationCoordinator.badge.browser.test.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,24 @@ it("does not toast a side chat open in its parent's right panel", async () => {
347347
expect(state.toast).not.toHaveBeenCalled();
348348
});
349349

350+
it.each([
351+
["closed", () => useRightPanelStore.getState().close(parentRef)],
352+
["showing another tab", () => useRightPanelStore.getState().open(parentRef, "files")],
353+
])("toasts a side chat when its parent's right panel is %s", async (_, hideSideChat) => {
354+
await using app = setup();
355+
state.inApp = true;
356+
focused = true;
357+
app.route.params = { environmentId: "one", threadId: "thread" };
358+
useRightPanelStore.getState().openSideChat(parentRef, "side" as never);
359+
hideSideChat();
360+
state.shells.set("one", withSideChat({}));
361+
app.start();
362+
state.shells.set("one", withSideChat({ latestTurn: completedTurn }));
363+
expect(state.toast).toHaveBeenCalledWith(
364+
expect.objectContaining({ title: "Side chat completed", description: "Side chat" }),
365+
);
366+
});
367+
350368
it.each(["hasPendingApprovals", "hasPendingUserInput"] as const)(
351369
"notifies for offline completion and %s once across reconnects",
352370
async (flag) => {

0 commit comments

Comments
 (0)