From f36b66e619da10974bd26dfaea89406147eb9486 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 13 Nov 2026 02:34:41 +0000 Subject: [PATCH] test(web): sidebar drag test ignores a fading row clone after folder collapse Collapsing a folder fades the removed row out as an aria-hidden clone that is removed when its 150ms animation finishes. The test's getByText absence check matched that clone, so it failed whenever a busy CI browser delayed the animation. Match the live row by its test id, which the clone drops. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/Sidebar.drag.browser.test.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/Sidebar.drag.browser.test.tsx b/apps/web/src/components/Sidebar.drag.browser.test.tsx index b6494d089ae1c..26ec42507ffa3 100644 --- a/apps/web/src/components/Sidebar.drag.browser.test.tsx +++ b/apps/web/src/components/Sidebar.drag.browser.test.tsx @@ -51,8 +51,11 @@ 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(); await userEvent.click(folder); - 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();