summaryrefslogtreecommitdiffhomepage
path: root/packages/app/e2e/prompt
diff options
context:
space:
mode:
Diffstat (limited to 'packages/app/e2e/prompt')
-rw-r--r--packages/app/e2e/prompt/prompt-slash-terminal.spec.ts25
1 files changed, 4 insertions, 21 deletions
diff --git a/packages/app/e2e/prompt/prompt-slash-terminal.spec.ts b/packages/app/e2e/prompt/prompt-slash-terminal.spec.ts
index 100d1878a..466b3ba1b 100644
--- a/packages/app/e2e/prompt/prompt-slash-terminal.spec.ts
+++ b/packages/app/e2e/prompt/prompt-slash-terminal.spec.ts
@@ -1,5 +1,5 @@
import { test, expect } from "../fixtures"
-import { waitTerminalReady } from "../actions"
+import { runPromptSlash, waitTerminalFocusIdle } from "../actions"
import { promptSelector, terminalSelector } from "../selectors"
test("/terminal toggles the terminal panel", async ({ page, gotoSession }) => {
@@ -7,29 +7,12 @@ test("/terminal toggles the terminal panel", async ({ page, gotoSession }) => {
const prompt = page.locator(promptSelector)
const terminal = page.locator(terminalSelector)
- const slash = page.locator('[data-slash-id="terminal.toggle"]').first()
await expect(terminal).not.toBeVisible()
- await prompt.fill("/terminal")
- await expect(slash).toBeVisible()
- await page.keyboard.press("Enter")
- await waitTerminalReady(page, { term: terminal })
+ await runPromptSlash(page, { prompt, text: "/terminal", id: "terminal.toggle" })
+ await waitTerminalFocusIdle(page, { term: terminal })
- // Terminal panel retries focus (immediate, RAF, 120ms, 240ms) after opening,
- // which can steal focus from the prompt and prevent fill() from triggering
- // the slash popover. Re-attempt click+fill until all retries are exhausted
- // and the popover appears.
- await expect
- .poll(
- async () => {
- await prompt.click().catch(() => false)
- await prompt.fill("/terminal").catch(() => false)
- return slash.isVisible().catch(() => false)
- },
- { timeout: 10_000 },
- )
- .toBe(true)
- await page.keyboard.press("Enter")
+ await runPromptSlash(page, { prompt, text: "/terminal", id: "terminal.toggle" })
await expect(terminal).not.toBeVisible()
})