From 88b46c6781f5236dbc0fe4379c7f8d1b57bcd2c9 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 06:33:29 +0000 Subject: [PATCH] test(app): cover collapsed pin shortcuts in one journey (#9366) Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> --- .../sidebar-workspace-pin-shortcut.spec.ts | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/packages/app/e2e/browser/sidebar-workspace-pin-shortcut.spec.ts b/packages/app/e2e/browser/sidebar-workspace-pin-shortcut.spec.ts index 7f9a7b980d..a480c6b2b8 100644 --- a/packages/app/e2e/browser/sidebar-workspace-pin-shortcut.spec.ts +++ b/packages/app/e2e/browser/sidebar-workspace-pin-shortcut.spec.ts @@ -146,7 +146,9 @@ async function installPinRpcGate( } test.describe("Pin workspace shortcut", () => { - test("dispatches pin once and keeps project creation reachable", async ({ page }) => { + test("pins and unpins across sidebar collapse and keeps project creation reachable", async ({ + page, + }) => { const workspace = await seedWorkspace({ repoPrefix: "pin-project-creation-", title: "Pinned workspace", @@ -169,11 +171,27 @@ test.describe("Pin workspace shortcut", () => { await expect(workspaceRow(page, workspace.workspaceId)).toHaveCount(1); }); - await test.step("keeps the pinned project available to workspace creation", async () => { + await test.step("unpins the active workspace while the Pinned section is collapsed", async () => { await page.keyboard.press(PIN_SHORTCUT); await expect(pinnedSection(page)).toBeVisible({ timeout: 10_000 }); expect(gate.sentCount()).toBe(3); + await page.getByTestId("sidebar-pinned-section-header").click(); + await expect(workspaceRow(page, workspace.workspaceId)).toHaveCount(0, { + timeout: 10_000, + }); + + await page.keyboard.press(PIN_SHORTCUT); + await expect(pinnedSection(page)).toHaveCount(0, { timeout: 10_000 }); + expect(gate.sentCount()).toBe(4); + await expect(workspaceRow(page, workspace.workspaceId)).toHaveCount(1); + }); + + await test.step("keeps the pinned project available to workspace creation", async () => { + await page.keyboard.press(PIN_SHORTCUT); + await expect(pinnedSection(page)).toBeVisible({ timeout: 10_000 }); + expect(gate.sentCount()).toBe(5); + await openNewWorkspaceComposer(page, workspace); await expectNewWorkspaceProjectSelected(page, workspace.projectDisplayName); }); @@ -203,27 +221,6 @@ test.describe("Pin workspace shortcut", () => { } }); - test("unpins the active workspace while the Pinned section is collapsed", async ({ page }) => { - const workspace = await seedWorkspace({ repoPrefix: "pin-shortcut-unpin-" }); - - try { - await gotoAppShell(page); - await openWorkspace(page, workspace.workspaceId); - - await page.keyboard.press(PIN_SHORTCUT); - await expect(pinnedSection(page)).toBeVisible({ timeout: 10_000 }); - - await page.getByTestId("sidebar-pinned-section-header").click(); - await expect(workspaceRow(page, workspace.workspaceId)).toHaveCount(0, { timeout: 10_000 }); - - await page.keyboard.press(PIN_SHORTCUT); - - await expect(pinnedSection(page)).toHaveCount(0, { timeout: 10_000 }); - } finally { - await workspace.cleanup(); - } - }); - test("pins the active workspace while its status group is collapsed", async ({ page }) => { const workspace = await seedWorkspace({ repoPrefix: "pin-shortcut-status-" });