prompt-slash-open.spec.ts 657 B

12345678910111213141516171819202122
  1. import { test, expect } from "./fixtures"
  2. import { promptSelector } from "./utils"
  3. test("smoke /open opens file picker dialog", async ({ page, gotoSession }) => {
  4. await gotoSession()
  5. await page.locator(promptSelector).click()
  6. await page.keyboard.type("/open")
  7. const command = page.locator('[data-slash-id="file.open"]')
  8. await expect(command).toBeVisible()
  9. await command.hover()
  10. await page.keyboard.press("Enter")
  11. const dialog = page.getByRole("dialog")
  12. await expect(dialog).toBeVisible()
  13. await expect(dialog.getByRole("textbox").first()).toBeVisible()
  14. await page.keyboard.press("Escape")
  15. await expect(dialog).toHaveCount(0)
  16. })