From 33c818cc6b73f7f5ef866a5c0719e0c7d9e75780 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 00:39:48 +0000 Subject: [PATCH] test(app): wait for sidebar context menu placement (#9351) The measuring surface is visible before layout replaces it with the positioned menu. Retry the original geometry assertions across that replacement instead of measuring it once. Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> --- packages/app/e2e/support/helpers/sidebar.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/app/e2e/support/helpers/sidebar.ts b/packages/app/e2e/support/helpers/sidebar.ts index 96d1441070..787eabf21b 100644 --- a/packages/app/e2e/support/helpers/sidebar.ts +++ b/packages/app/e2e/support/helpers/sidebar.ts @@ -31,10 +31,13 @@ async function expectContextMenuAtPointer( menuTestID: string, anchor: ContextMenuAnchor, ): Promise { - const bounds = await page.getByTestId(menuTestID).boundingBox(); - if (!bounds) throw new Error(`Could not measure ${menuTestID}`); - expect(Math.abs(bounds.x - anchor.x)).toBeLessThanOrEqual(2); - expect(Math.abs(bounds.y - (anchor.y + 4))).toBeLessThanOrEqual(2); + // The visible measuring surface is replaced when layout places the menu at its anchor. + await expect(async () => { + const bounds = await page.getByTestId(menuTestID).boundingBox(); + if (!bounds) throw new Error(`Could not measure ${menuTestID}`); + expect(Math.abs(bounds.x - anchor.x)).toBeLessThanOrEqual(2); + expect(Math.abs(bounds.y - (anchor.y + 4))).toBeLessThanOrEqual(2); + }).toPass({ timeout: 10_000 }); } export async function openWorkspaceContextMenu(page: Page, workspaceId: string): Promise {