The spec watched the day flip from provisional to final on a hero that only its own subject was keeping on screen: the arrival marker was the last thing in the calm-degrade guard holding the hero up for the bare fixture account, so removing the arrival chip took the hero with it and left the spec nothing to observe. Putting the arrival back into the guard would bring back a worse problem. An arrival-only digest lands in the compact all-clear composition, which would tell someone with no readings at all that everything is clear - a claim about their health made from nothing, and made only on the days something happened to sync. The guard stays as it is; the fixture was what was wrong. So the spec now seeds its own precondition: one integration needing a reconnect, which is an ordinary Today for anyone whose readings come from a device. It is read fresh on every request rather than through the dashboard snapshot cache, so unlike a seeded score or briefing it cannot lose a race with a cached snapshot, and the rail item admits no module gate and no dismiss path. The row is removed again afterwards. While the spec was open: it now pins the state it starts from. It only ever asserted that the pending-sleep note was absent at the end, which a note that never rendered also satisfies. It asserts the note is up and the day reads provisional first, so the two halves are one assertion with the number flipped. The component side is pinned in unit tests, since the spec needs a built app and a database to run.
e2e/
End-to-end browser tests. Playwright 1.60 drives a production build of the app against a real PostgreSQL, with @axe-core/playwright for accessibility assertions. This is the heaviest test tier; CI runs it on every PR, and locally it is worth running when a change touches a UI flow.
Running
pnpm e2e
The Playwright config (../playwright.config.ts) builds the app (next build) and brings up Postgres before the specs run; setup/global-setup.ts seeds the auth + fixture state. The suite is not part of the fast local gate (typecheck / lint / test) — it surfaces at PR CI, so expect responsive/wizard/nav reworks to flag here first.
Layout
setup/—test.ts(the suite'stest+expectentry point),global-setup.ts(auth + DB seeding),test-helpers.ts(shared login + navigation helpers).utils/— fixtures such asmock-dashboard-snapshot.ts.*.spec.ts— one spec per flow: auth/login/redirect, dashboard, charts, the medication-wizard cadences (medications-wizard-*), insights generation + scroll restoration, doctor report, settings, mobile-viewport consistency, locale switch, accessibility (a11y.spec.ts), and thev1427-*regression set.
Conventions
Import test and expect from ./setup/test, never from @playwright/test — types (Page, Route, …) still come from the package. The entry point extends Playwright's test with an automatic fixture that drops route handlers and page listeners after every test, so a handler left in flight cannot fail the test it belonged to once the context closes. src/__tests__/e2e-route-cleanup-guard.test.ts enforces the import boundary.
Assert against stable data-* attributes (data-slot, data-display-step, root display attrs), not viewport-dependent visible text. Responsive sm:hidden UI changes break getByText on desktop while the underlying element is still present — anchoring on data attributes keeps the specs stable across breakpoints. See ../CLAUDE.md.