summaryrefslogtreecommitdiffhomepage
path: root/packages/app/e2e/file-open.spec.ts
blob: fb7104b6b05dbfa60bbcd1d0dc3853a663fed433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { test, expect } from "./fixtures"
import { modKey } from "./utils"

test("can open a file tab from the search palette", 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("package.json")

  const fileItem = dialog.locator('[data-slot="list-item"][data-key^="file:"]').first()
  await expect(fileItem).toBeVisible()
  await fileItem.click()

  await expect(dialog).toHaveCount(0)

  const tabs = page.locator('[data-component="tabs"][data-variant="normal"]')
  await expect(tabs.locator('[data-slot="tabs-trigger"]').first()).toBeVisible()
})