mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-29 16:20:59 +08:00
Co-authored-by: dnlklmn <pelicansinberlin@gmail.com> Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
27 lines
818 B
TypeScript
27 lines
818 B
TypeScript
import { test, expect } from "@tests/support/fixtures.js";
|
|
|
|
test("open and close modal", async ({ page }) => {
|
|
await page.goto("/");
|
|
await page.locator("body").press(`?`);
|
|
await expect(
|
|
page.locator(".modal").getByText("Keyboard shortcuts"),
|
|
).toBeVisible();
|
|
|
|
// Close modal by pressing the `Esc` key.
|
|
await page.locator("body").press("Escape");
|
|
await expect(
|
|
page.locator(".modal").getByText("Keyboard shortcuts"),
|
|
).not.toBeVisible();
|
|
|
|
await page.locator("body").press(`?`);
|
|
await expect(
|
|
page.locator(".modal").getByText("Keyboard shortcuts"),
|
|
).toBeVisible();
|
|
|
|
// Close modal by clicking outside of it.
|
|
await page.locator(".overlay").click({ position: { x: 10, y: 10 } });
|
|
await expect(
|
|
page.locator(".modal").getByText("Keyboard shortcuts"),
|
|
).not.toBeVisible();
|
|
});
|