diff options
| author | Adam <[email protected]> | 2026-01-22 06:19:46 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-01-22 07:34:44 -0600 |
| commit | 6f7d710129bfd2859dbdf0716003d486a4afeda8 (patch) | |
| tree | 8bf4373cd22132536af2ba8e39c033e90904095a | |
| parent | 513a8a3d26c2b325a650121e6c579aaa4a925027 (diff) | |
| download | opencode-6f7d710129bfd2859dbdf0716003d486a4afeda8.tar.gz opencode-6f7d710129bfd2859dbdf0716003d486a4afeda8.zip | |
test(app): settings smoke tests
| -rw-r--r-- | packages/app/e2e/settings.spec.ts | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/packages/app/e2e/settings.spec.ts b/packages/app/e2e/settings.spec.ts new file mode 100644 index 000000000..09dc942cc --- /dev/null +++ b/packages/app/e2e/settings.spec.ts @@ -0,0 +1,44 @@ +import { test, expect } from "./fixtures" +import { modKey } from "./utils" + +test("smoke settings dialog opens, switches tabs, closes", async ({ page, gotoSession }) => { + await gotoSession() + + const dialog = page.getByRole("dialog") + + await page.keyboard.press(`${modKey}+Comma`).catch(() => undefined) + + const opened = await dialog + .waitFor({ state: "visible", timeout: 3000 }) + .then(() => true) + .catch(() => false) + + if (!opened) { + await page.getByRole("button", { name: "Settings" }).first().click() + await expect(dialog).toBeVisible() + } + + await dialog.getByRole("tab", { name: "Shortcuts" }).click() + await expect(dialog.getByRole("button", { name: "Reset to defaults" })).toBeVisible() + await expect(dialog.getByPlaceholder("Search shortcuts")).toBeVisible() + + await page.keyboard.press("Escape") + + const closed = await dialog + .waitFor({ state: "detached", timeout: 1500 }) + .then(() => true) + .catch(() => false) + + if (closed) return + + await page.keyboard.press("Escape") + const closedSecond = await dialog + .waitFor({ state: "detached", timeout: 1500 }) + .then(() => true) + .catch(() => false) + + if (closedSecond) return + + await page.locator('[data-component="dialog-overlay"]').click({ position: { x: 5, y: 5 } }) + await expect(dialog).toHaveCount(0) +}) |
