From e260f93cc7b6098f6b175bd0e5c7eb24d3f03cf4 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Mon, 9 Nov 2026 12:45:13 +0000 Subject: [PATCH] Wait for sidebar label rows before moving a workspace in CI (#9199) * test(app): wait for sidebar label rows before moving workspace * test(app): identify the rendered label before checking row readiness --------- Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> --- .../app/e2e/support/helpers/sidebar-views.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/app/e2e/support/helpers/sidebar-views.ts b/packages/app/e2e/support/helpers/sidebar-views.ts index 74952d3ff6..0c869235ae 100644 --- a/packages/app/e2e/support/helpers/sidebar-views.ts +++ b/packages/app/e2e/support/helpers/sidebar-views.ts @@ -110,6 +110,18 @@ function sidebarViews( label: { name: "Unlabelled", color: "red" }, assigned: true, }); + // Wait for the named label folder alongside the built-in unlabelled bucket. + // Counts alone can match stale Inbox/Later rows from the preceding move. + await expect( + slot.getByRole("button", { name: "Toggle Unlabelled", exact: true }), + ).toHaveCount(2); + // Observe both label rows before removing Later so a stale single row + // cannot satisfy the final readiness check. + const moveWorkspace = slot.getByRole("button", { + name: `Move workspace ${workspaceId}`, + exact: true, + }); + await expect(moveWorkspace).toHaveCount(2); await client.setWorkspaceLabel({ workspaceId, label: { name: "Later", color: "red" }, @@ -122,9 +134,9 @@ function sidebarViews( ?.labels, ) .toEqual(["Unlabelled"]); - await slot - .getByRole("button", { name: `Move workspace ${workspaceId}`, exact: true }) - .click(); + // The daemon reply does not guarantee the browser has applied the removal. + await expect(moveWorkspace).toHaveCount(1); + await moveWorkspace.click(); await slot.getByRole("button", { name: "Move to Inbox", exact: true }).click(); await expect .poll(