diff --git a/apps/web/src/components/Sidebar.drag.browser.test.tsx b/apps/web/src/components/Sidebar.drag.browser.test.tsx index 53d6744f27b7c..c5811df12b765 100644 --- a/apps/web/src/components/Sidebar.drag.browser.test.tsx +++ b/apps/web/src/components/Sidebar.drag.browser.test.tsx @@ -51,10 +51,13 @@ it("keeps the title when dragging a search result from a collapsed folder", asyn }); const folder = page.getByRole("button", { name: /^render/ }); await expect.element(folder).toHaveAttribute("aria-expanded", "true"); + // A removed row fades out as a clone without its test id, so match the live row only. + const secondRow = page.getByTestId("sidebar-row-folder").filter({ hasText: second.title }); + await expect.element(secondRow).toBeInTheDocument(); // The shift guard drops pointer presses on a row that appeared under 500ms ago; keys pass. folder.element().focus(); await userEvent.keyboard("{Enter}"); - await expect.element(page.getByText(second.title, { exact: true })).not.toBeInTheDocument(); + await expect.element(secondRow).not.toBeInTheDocument(); await userEvent.fill(page.getByRole("combobox", { name: "Search threads" }), "search-target"); const result = page.getByRole("option", { name: /Thread search-target/ }); await expect.element(result).toBeVisible();