mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 00:12:11 +00:00
test(app): file viewer smoke test
This commit is contained in:
parent
c031139b89
commit
0a678eeacc
2 changed files with 32 additions and 3 deletions
28
packages/app/e2e/file-viewer.spec.ts
Normal file
28
packages/app/e2e/file-viewer.spec.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { test, expect } from "./fixtures"
|
||||
import { modKey } from "./utils"
|
||||
|
||||
test("smoke file viewer renders real file content", async ({ page, gotoSession }) => {
|
||||
await gotoSession()
|
||||
|
||||
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")
|
||||
|
||||
const fileItem = dialog.locator('[data-slot="list-item"][data-key="file:packages/app/package.json"]')
|
||||
await expect(fileItem).toBeVisible()
|
||||
await fileItem.click()
|
||||
|
||||
await expect(dialog).toHaveCount(0)
|
||||
|
||||
const tab = page.getByRole("tab", { name: "package.json" })
|
||||
await expect(tab).toBeVisible()
|
||||
await tab.click()
|
||||
|
||||
const code = page.locator('[data-component="code"]').first()
|
||||
await expect(code).toBeVisible()
|
||||
await expect(code.getByText("@opencode-ai/app")).toBeVisible()
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue