Skip to content

Commit cf81e84

Browse files
test(web): select the command palette submenu by name
Order-dependent saved-project localStorage can hide the optional current-project row. Select the named submenu before Enter so its position does not change the first-project highlight test.
1 parent df2dccf commit cf81e84

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎apps/web/src/components/CommandPalette.browser.test.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,9 @@ describe("CommandPalette open intents", () => {
107107
await expect
108108
.element(page.getByPlaceholder("Search commands, projects, and threads..."))
109109
.toHaveFocus();
110-
await userEvent.keyboard("{ArrowDown}");
111-
await expect
112-
.element(page.getByRole("option", { name: /^New thread in\.\.\./ }))
113-
.toHaveAttribute("data-highlighted");
110+
const newThreadIn = page.getByRole("option", { name: /^New thread in\.\.\./ });
111+
await userEvent.hover(newThreadIn);
112+
await expect.element(newThreadIn).toHaveAttribute("data-highlighted");
114113
await userEvent.keyboard("{Enter}");
115114

116115
await expect.element(page.getByPlaceholder("Search...")).toHaveFocus();

0 commit comments

Comments
 (0)