summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorAdam <[email protected]>2026-01-22 12:19:47 -0600
committerAdam <[email protected]>2026-01-22 12:19:57 -0600
commit93044cc7d11d406a661278ed7f05065d85cda60a (patch)
treeb041bd80c09c634e07af872e2d99fb548dcc2515 /packages
parent5a4eec5b08be6c36561fa06f056a330d3b402b34 (diff)
downloadopencode-93044cc7d11d406a661278ed7f05065d85cda60a.tar.gz
opencode-93044cc7d11d406a661278ed7f05065d85cda60a.zip
test(app): fix windows paths
Diffstat (limited to 'packages')
-rw-r--r--packages/app/e2e/file-viewer.spec.ts11
-rw-r--r--packages/app/e2e/prompt-mention.spec.ts11
-rw-r--r--packages/app/e2e/tsconfig.json8
3 files changed, 25 insertions, 5 deletions
diff --git a/packages/app/e2e/file-viewer.spec.ts b/packages/app/e2e/file-viewer.spec.ts
index a9fee3c5d..1e0f8a6f2 100644
--- a/packages/app/e2e/file-viewer.spec.ts
+++ b/packages/app/e2e/file-viewer.spec.ts
@@ -4,15 +4,22 @@ import { modKey } from "./utils"
test("smoke file viewer renders real file content", async ({ page, gotoSession }) => {
await gotoSession()
+ const sep = process.platform === "win32" ? "\\" : "/"
+ const file = ["packages", "app", "package.json"].join(sep)
+
await page.keyboard.press(`${modKey}+P`)
const dialog = page.getByRole("dialog")
await expect(dialog).toBeVisible()
const input = dialog.getByRole("textbox").first()
- await input.fill("packages/app/package.json")
+ await input.fill(file)
- const fileItem = dialog.locator('[data-slot="list-item"][data-key="file:packages/app/package.json"]')
+ const fileItem = dialog
+ .locator(
+ '[data-slot="list-item"][data-key^="file:"][data-key*="packages"][data-key*="app"][data-key$="package.json"]',
+ )
+ .first()
await expect(fileItem).toBeVisible()
await fileItem.click()
diff --git a/packages/app/e2e/prompt-mention.spec.ts b/packages/app/e2e/prompt-mention.spec.ts
index d71dc0b49..113b8465f 100644
--- a/packages/app/e2e/prompt-mention.spec.ts
+++ b/packages/app/e2e/prompt-mention.spec.ts
@@ -5,16 +5,21 @@ test("smoke @mention inserts file pill token", async ({ page, gotoSession }) =>
await gotoSession()
await page.locator(promptSelector).click()
- await page.keyboard.type("@packages/app/package.json")
+ const sep = process.platform === "win32" ? "\\" : "/"
+ const file = ["packages", "app", "package.json"].join(sep)
+ const filePattern = /packages[\\/]+app[\\/]+\s*package\.json/
- const suggestion = page.getByRole("button", { name: /packages\/app\/\s*package\.json/ }).first()
+ await page.keyboard.type(`@${file}`)
+
+ const suggestion = page.getByRole("button", { name: filePattern }).first()
await expect(suggestion).toBeVisible()
await suggestion.hover()
await page.keyboard.press("Tab")
- const pill = page.locator(`${promptSelector} [data-type="file"][data-path="packages/app/package.json"]`)
+ const pill = page.locator(`${promptSelector} [data-type="file"]`).first()
await expect(pill).toBeVisible()
+ await expect(pill).toHaveAttribute("data-path", filePattern)
await page.keyboard.type(" ok")
await expect(page.locator(promptSelector)).toContainText("ok")
diff --git a/packages/app/e2e/tsconfig.json b/packages/app/e2e/tsconfig.json
new file mode 100644
index 000000000..76438a03c
--- /dev/null
+++ b/packages/app/e2e/tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "extends": "../tsconfig.json",
+ "compilerOptions": {
+ "noEmit": true,
+ "types": ["node"]
+ },
+ "include": ["./**/*.ts"]
+}