test(e2e): leave fullscreen before resizing and read the watermarked statement

This commit is contained in:
shira committed 2026-10-11 14:52:52 +03:00
1 parent 72d8f54d1a
commit d5e169e71b
4 files changed
+57 -20

No files matched your search

+1 -8
View File
@@ -1,4 +1,5 @@
import { expect, test, type Locator, type Page, type Request, type Route } from "@playwright/test";
import { expectNoHorizontalOverflow } from "./viewport";
// States, focus, and error binding of the minimal path with a stubbed API. The
// API answers come from this file, so each test controls one failure at a time
@@ -161,14 +162,6 @@ async function mockApi(page: Page, routes: Routes): Promise<Map<string, number>>
return calls;
}
async function expectNoHorizontalOverflow(page: Page, width: number): Promise<void> {
await page.setViewportSize({ width, height: 900 });
const overflow = await page.evaluate(
() => document.documentElement.scrollWidth > window.innerWidth,
);
expect(overflow, `no horizontal overflow at ${width}px`).toBe(false);
}
// The focus outline comes from the global :focus-visible rule. A control that
// has focus from the keyboard must match that selector and draw an outline.
async function expectFocusOutline(target: Locator): Promise<void> {