mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
test(app): @ attachment smoke test
This commit is contained in:
21
packages/app/e2e/prompt-mention.spec.ts
Normal file
21
packages/app/e2e/prompt-mention.spec.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { test, expect } from "./fixtures"
|
||||
import { promptSelector } from "./utils"
|
||||
|
||||
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 suggestion = page.getByRole("button", { name: /packages\/app\/\s*package\.json/ }).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"]`)
|
||||
await expect(pill).toBeVisible()
|
||||
|
||||
await page.keyboard.type(" ok")
|
||||
await expect(page.locator(promptSelector)).toContainText("ok")
|
||||
})
|
||||
@@ -23,7 +23,7 @@ Add 6 smoke tests to `packages/app/e2e/`:
|
||||
|
||||
- [x] 1. Settings dialog open / switch / close (`packages/app/e2e/settings.spec.ts`)
|
||||
- [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
|
||||
- [x] 3. Prompt @mention inserts a file pill token (`packages/app/e2e/prompt-mention.spec.ts`)
|
||||
- [ ] 4. Model selection UI works end-to-end
|
||||
- [ ] 5. File viewer renders real file content
|
||||
- [ ] 8. Terminal init + create new terminal
|
||||
|
||||
Reference in New Issue
Block a user