Skip to content

Commit 2297ace

Browse files
test(web): pass the selection in the merged window-return test
AI-assisted; verified with the tests and tools listed above.
1 parent 0a72508 commit 2297ace

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/web/src/components/ChatView.logic.browser.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ it("refocuses the composer on window return from a clicked area after a bare key
7070
// A window switch can deliver a lone modifier key without moving focus.
7171
await userEvent.keyboard("{Shift}");
7272
expect(
73-
shouldRefocusComposerOnWindowFocus(document.activeElement),
73+
shouldRefocusComposerOnWindowFocus(document.activeElement, document.getSelection()),
7474
"a clicked area counts as reached from the keyboard after a bare key press",
7575
).toBe(true);
7676

@@ -79,5 +79,7 @@ it("refocuses the composer on window return from a clicked area after a bare key
7979
await userEvent.keyboard("{F6}");
8080
controller.move(1);
8181
expect(document.activeElement).toBe(conversation);
82-
expect(shouldRefocusComposerOnWindowFocus(document.activeElement)).toBe(false);
82+
expect(shouldRefocusComposerOnWindowFocus(document.activeElement, document.getSelection())).toBe(
83+
false,
84+
);
8385
});

0 commit comments

Comments
 (0)