From 092edced9fe8d4c8b814279cd8cd5b6236d556d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 7 Aug 2026 17:14:41 +0200 Subject: [PATCH] test(e2e): open the mood sheet's full form before measuring it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mood sheet opens on the five-face quick check and reveals the rest of the form, timestamp row included, once a face is picked. The dialog-overflow spec measured the quick check instead, found no date field, and failed on its own readiness gate rather than on the layout — a guard that cannot reach the state it is about proves nothing either way. It now picks a face and waits for the annotate panel, which is the state the report describes. --- e2e/dialog-horizontal-overflow.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/e2e/dialog-horizontal-overflow.spec.ts b/e2e/dialog-horizontal-overflow.spec.ts index 4382596e7..9a66f45f2 100644 --- a/e2e/dialog-horizontal-overflow.spec.ts +++ b/e2e/dialog-horizontal-overflow.spec.ts @@ -57,6 +57,8 @@ interface DialogCase { path: string; /** Accessible name of the control that opens the dialog. */ trigger: RegExp; + /** Reach the state the report describes, when the form does not open in it. */ + prepare?: (page: import("@playwright/test").Page) => Promise; /** Something inside the dialog that proves it rendered its form, not a shell. */ ready: string; } @@ -72,6 +74,16 @@ const DIALOGS: DialogCase[] = [ name: "mood add", path: "/mood", trigger: /^add$/i, + // The mood sheet opens on the five-face quick check; the timestamp row + // (and everything else) appears once a face is picked. Measuring the + // quick check alone would measure a sheet that has almost nothing in it. + prepare: async (page) => { + await page.locator('[data-slot="mood-face"]').first().click(); + await page + .locator('[data-slot="mood-annotate-panel"]') + .first() + .waitFor({ state: "visible" }); + }, ready: '[data-slot="date-time-field"]', }, { @@ -199,6 +211,7 @@ test.describe("add/edit dialogs do not scroll sideways", () => { const surface = page.locator(SURFACE).first(); await expect(surface).toBeVisible(); + await dialog.prepare?.(page); // Gate on the form's own content, not the shell: the surface mounts // before the fields do, and measuring the empty frame would pass // against exactly the layout this spec exists to catch.