Ver Fonte

test(app): slash command smoke tests

Adam há 3 semanas atrás
pai
commit
ec53a7962e

+ 22 - 0
packages/app/e2e/prompt-slash-open.spec.ts

@@ -0,0 +1,22 @@
+import { test, expect } from "./fixtures"
+import { promptSelector } from "./utils"
+
+test("smoke /open opens file picker dialog", async ({ page, gotoSession }) => {
+  await gotoSession()
+
+  await page.locator(promptSelector).click()
+  await page.keyboard.type("/open")
+
+  const command = page.locator('[data-slash-id="file.open"]')
+  await expect(command).toBeVisible()
+  await command.hover()
+
+  await page.keyboard.press("Enter")
+
+  const dialog = page.getByRole("dialog")
+  await expect(dialog).toBeVisible()
+  await expect(dialog.getByRole("textbox").first()).toBeVisible()
+
+  await page.keyboard.press("Escape")
+  await expect(dialog).toHaveCount(0)
+})

+ 1 - 1
specs/08-app-e2e-smoke-suite.md

@@ -22,7 +22,7 @@ Add 6 smoke tests to `packages/app/e2e/`:
 ### Progress
 
 - [x] 1. Settings dialog open / switch / close (`packages/app/e2e/settings.spec.ts`)
-- [ ] 2. Prompt slash command path: `/open` opens file picker
+- [x] 2. Prompt slash command path: `/open` opens file picker (`packages/app/e2e/prompt-slash-open.spec.ts`)
 - [ ] 3. Prompt @mention inserts a file pill token
 - [ ] 4. Model selection UI works end-to-end
 - [ ] 5. File viewer renders real file content