From cdd7800fed3d87757952a368467e703ac4d15873 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 09:46:14 +0000 Subject: [PATCH] test(app): wait for workspace hover cards to settle (#8846) Keyboard focus can briefly mount the next card while the previous card closes. Poll uniqueness and visibility together so the assertion tolerates that transition but still rejects persistent duplicates. Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> --- packages/app/e2e/support/helpers/sidebar.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/app/e2e/support/helpers/sidebar.ts b/packages/app/e2e/support/helpers/sidebar.ts index 9fd61a8451..6e0a4abedc 100644 --- a/packages/app/e2e/support/helpers/sidebar.ts +++ b/packages/app/e2e/support/helpers/sidebar.ts @@ -81,7 +81,13 @@ export async function scrollWorkspaceList(page: Page): Promise { } export async function expectWorkspaceHoverCardOpen(page: Page): Promise { - await expect(page.getByTestId("workspace-hover-card")).toBeVisible(); + const cards = page.getByTestId("workspace-hover-card"); + // Keyboard navigation can leave the previous card closing while the next opens. + // Retry both checks together: another card may mount between count and visibility. + await expect(async () => { + expect(await cards.count()).toBe(1); + expect(await cards.isVisible()).toBe(true); + }).toPass({ timeout: 10_000 }); } export async function expectWorkspaceHoverCardStaysOpen(page: Page): Promise {