summaryrefslogtreecommitdiffhomepage
path: root/packages/app/e2e/projects/projects-switch.spec.ts
diff options
context:
space:
mode:
authorBrendan Allan <[email protected]>2026-03-19 21:59:14 +0800
committerGitHub <[email protected]>2026-03-19 19:29:14 +0530
commit84f60d97a0c37c9136dfd965a66a0c8685a19e71 (patch)
tree3257e9da5114ddf3775b310db9b5707cc48267c4 /packages/app/e2e/projects/projects-switch.spec.ts
parentcbf4b68fee8ff45c10a484b27f94e2dbe5f5dea2 (diff)
downloadopencode-84f60d97a0c37c9136dfd965a66a0c8685a19e71.tar.gz
opencode-84f60d97a0c37c9136dfd965a66a0c8685a19e71.zip
app: fix workspace flicker when switching directories (#18207)
Co-authored-by: Shoubhit Dash <[email protected]>
Diffstat (limited to 'packages/app/e2e/projects/projects-switch.spec.ts')
-rw-r--r--packages/app/e2e/projects/projects-switch.spec.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/packages/app/e2e/projects/projects-switch.spec.ts b/packages/app/e2e/projects/projects-switch.spec.ts
index 6ad64f592..1416aec72 100644
--- a/packages/app/e2e/projects/projects-switch.spec.ts
+++ b/packages/app/e2e/projects/projects-switch.spec.ts
@@ -1,7 +1,7 @@
import { base64Decode } from "@opencode-ai/util/encode"
import type { Page } from "@playwright/test"
import { test, expect } from "../fixtures"
-import { defocus, createTestProject, cleanupTestProject, openSidebar, sessionIDFromUrl, waitSlug } from "../actions"
+import { defocus, createTestProject, cleanupTestProject, openSidebar, sessionIDFromUrl, waitDir, waitSlug } from "../actions"
import { projectSwitchSelector, promptSelector, workspaceItemSelector, workspaceNewSessionSelector } from "../selectors"
import { dirSlug, resolveDirectory } from "../utils"
@@ -100,11 +100,8 @@ test("switching back to a project opens the latest workspace session", async ({
await expect(btn).toBeVisible()
await btn.click({ force: true })
- // A new workspace can be discovered via a transient slug before the route and sidebar
- // settle to the canonical workspace path on Windows, so interact with either and assert
- // against the resolved workspace slug.
await waitSlug(page)
- await expect(page).toHaveURL(new RegExp(`/${next}/session(?:[/?#]|$)`))
+ await waitDir(page, space)
// Create a session by sending a prompt
const prompt = page.locator(promptSelector)
@@ -132,6 +129,7 @@ test("switching back to a project opens the latest workspace session", async ({
await expect(rootButton).toBeVisible()
await rootButton.click()
+ await waitDir(page, space)
await expect.poll(() => sessionIDFromUrl(page.url()) ?? "").toBe(created)
await expect(page).toHaveURL(new RegExp(`/session/${created}(?:[/?#]|$)`))
},