file-open.spec.ts 752 B

1234567891011121314151617181920212223
  1. import { test, expect } from "./fixtures"
  2. import { modKey } from "./utils"
  3. test("can open a file tab from the search palette", async ({ page, gotoSession }) => {
  4. await gotoSession()
  5. await page.keyboard.press(`${modKey}+P`)
  6. const dialog = page.getByRole("dialog")
  7. await expect(dialog).toBeVisible()
  8. const input = dialog.getByRole("textbox").first()
  9. await input.fill("package.json")
  10. const fileItem = dialog.locator('[data-slot="list-item"][data-key^="file:"]').first()
  11. await expect(fileItem).toBeVisible()
  12. await fileItem.click()
  13. await expect(dialog).toHaveCount(0)
  14. const tabs = page.locator('[data-component="tabs"][data-variant="normal"]')
  15. await expect(tabs.locator('[data-slot="tabs-trigger"]').first()).toBeVisible()
  16. })