diff --git a/e2e/medications-wizard-daily.spec.ts b/e2e/medications-wizard-daily.spec.ts index 65b23df62..7b62a9670 100644 --- a/e2e/medications-wizard-daily.spec.ts +++ b/e2e/medications-wizard-daily.spec.ts @@ -59,6 +59,9 @@ test.describe("medication wizard — daily", () => { // Step 4 — course window (today by default). await expectStep(page, 4); + // `DateField` keeps the ISO value on a hidden native date input + // (data-slot), while the visible overlay paints the locale-formatted + // string. Assert the committed ISO value on the hidden input. await expect( page.locator('[data-slot="course-window-starts"]'), ).toHaveValue(/^\d{4}-\d{2}-\d{2}$/); diff --git a/e2e/medications-wizard-oneshot.spec.ts b/e2e/medications-wizard-oneshot.spec.ts index a5506caa3..9bb93e075 100644 --- a/e2e/medications-wizard-oneshot.spec.ts +++ b/e2e/medications-wizard-oneshot.spec.ts @@ -62,7 +62,15 @@ test.describe("medication wizard — one-shot", () => { // Step 4 — course window. Set startsOn to a deterministic date so // the post body assertion below is stable. await expectStep(page, 4); - await page.locator('[data-slot="course-window-starts"]').fill("2026-10-15"); + // `DateField` rides a visible text overlay (the data-testid) that parses + // a typed ISO string back to the canonical value; the hidden native input + // (data-slot) carries the committed ISO. Type into the overlay, then blur + // so the parse commits. + await page.getByTestId("course-window-starts-field").fill("2026-10-15"); + await page.getByTestId("course-window-starts-field").blur(); + await expect( + page.locator('[data-slot="course-window-starts"]'), + ).toHaveValue("2026-10-15"); await clickNext(page); // Step 5 — pick Einmalig. The path compresses to 5 steps the