From 2b639f1f44caf2cfe9deabeecf6cc7da6012ffb8 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sat, 1 Aug 2026 03:22:09 +0200 Subject: [PATCH] test(app): scope sidebar fixtures by identity Shared E2E daemon state may contain unrelated projects. Keep stale-route coverage tied to its named missing project and drag only the two rows seeded by the reorder spec. --- packages/app/e2e/new-workspace-entry.spec.ts | 3 +-- packages/app/e2e/sidebar-reorder.spec.ts | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/app/e2e/new-workspace-entry.spec.ts b/packages/app/e2e/new-workspace-entry.spec.ts index bc4c64229e..fae10ce821 100644 --- a/packages/app/e2e/new-workspace-entry.spec.ts +++ b/packages/app/e2e/new-workspace-entry.spec.ts @@ -15,7 +15,7 @@ import { seedSavedSettingsHosts } from "./helpers/settings"; import { getServerId } from "./helpers/server-id"; import { projectEquivalenceViewKey } from "./helpers/project-view-key"; import { clickArchiveWorkspaceMenuItem, expectWorkspaceAbsentFromSidebar } from "./helpers/sidebar"; -import { waitForNoProjectsInSidebar, waitForSidebarHydration } from "./helpers/workspace-ui"; +import { waitForSidebarHydration } from "./helpers/workspace-ui"; // Model B entry points into the New Workspace screen. The surviving entries are // the global button (universal) and each project's per-row New workspace icon @@ -112,7 +112,6 @@ test.describe("New workspace entry points", () => { test("a stale project route keeps the New Workspace controls enabled", async ({ page }) => { await gotoAppShell(page); - await waitForNoProjectsInSidebar(page); await openMissingProjectNewWorkspaceComposer(page, { serverId: getServerId(), projectId: "missing-project", diff --git a/packages/app/e2e/sidebar-reorder.spec.ts b/packages/app/e2e/sidebar-reorder.spec.ts index 0979694f0a..b8019537c5 100644 --- a/packages/app/e2e/sidebar-reorder.spec.ts +++ b/packages/app/e2e/sidebar-reorder.spec.ts @@ -1,6 +1,7 @@ import type { Locator } from "@playwright/test"; import { expect, test } from "./fixtures"; import { gotoAppShell } from "./helpers/app"; +import { projectEquivalenceViewKey } from "./helpers/project-view-key"; import { getServerId } from "./helpers/server-id"; import { seedWorkspace } from "./helpers/seed-client"; import { waitForSidebarHydration } from "./helpers/workspace-ui"; @@ -56,7 +57,11 @@ test("projects and workspaces reorder with an immediate mouse drag", async ({ pa await gotoAppShell(page); await waitForSidebarHydration(page); - await quickDragFirstRowAfterSecond(page.locator('[data-testid^="sidebar-project-row-"]')); + const firstProjectTestId = `sidebar-project-row-${projectEquivalenceViewKey(firstProject.projectKey)}`; + const secondProjectTestId = `sidebar-project-row-${projectEquivalenceViewKey(secondProject.projectKey)}`; + await quickDragFirstRowAfterSecond( + page.locator(`[data-testid="${firstProjectTestId}"], [data-testid="${secondProjectTestId}"]`), + ); const firstWorkspaceTestId = `sidebar-workspace-row-${getServerId()}:${firstProject.workspaceId}`; const secondWorkspaceTestId = `sidebar-workspace-row-${getServerId()}:${secondWorkspace.workspace.id}`; await quickDragFirstRowAfterSecond(