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
@@ -7,6 +7,7 @@ import {
type Response,
type Route,
} from "@playwright/test";
import { expectNoHorizontalOverflow } from "./viewport";
type InboxMessage = {
text?: string;
@@ -173,14 +174,6 @@ async function focusWithKeyboard(page: Page, target: Locator): Promise<void> {
throw new Error("Keyboard navigation did not reach the assessment action.");
}
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);
}
async function navigateInApp(page: Page, path: string): Promise<void> {
await page.evaluate((target) => {
window.history.pushState(window.history.state, "", target);