Files
HealthLog/e2e
Marc-André Bombeck e84c358fdf fix(charts): match chart loading shells to the charts they become
The footer reserve under a day-linked chart's loading shell still held the
caption line that was dropped from those charts, so every such shell stood
20 px taller than its chart (40 px on a phone). The dashboard's mood chart
loaded behind the generic shell, which is about 30 px shorter than the
mood card. When the shared chart chunk arrived late the dashboard's chart
row changed height under a reader already scrolled past it; the tablet
shell journey measured <main> right after such a swap and found it no
longer at its end.

The reserve now holds only the day rug, and the mood chart gets a shell
built from the same card primitives and boxes. The tablet journey also waits
for every chart cell to reveal and every loading shell to go before it
scrolls to the end, instead of trusting two equal heights 250 ms apart.
2026-11-15 10:58:13 +01:00
..

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's test + expect entry point), global-setup.ts (auth + DB seeding), test-helpers.ts (shared login + navigation helpers).
  • utils/ — fixtures such as mock-dashboard-snapshot.ts.
  • fixtures/ — synthetic payloads a journey uploads, built in code rather than committed as blobs so the content stays reviewable (apple-health-export.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 the v1427-* 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.