Files
HealthLog/e2e
Marc-André Bombeck 25477e8aea test(e2e): unblock chart-overlay toggle + mobile x-axis tick wait
Two specs have been red on main since the v1.4.20 hero rewrite, spamming
the GitHub Actions failure mailer on every push:

1. chart-overlay-controls.spec.ts — the test opens the dashboard's chart
   overlay popover and toggles 'target range' on. The Radix dropdown
   content portals to the document body, so on the 393×851 Pixel 5 and
   near the bottom of the 1280×720 desktop viewport the toggle's bbox
   lands below the fold. `click({force:true})` still asserts the bbox
   intersects the viewport and refuses to fire, and
   `scrollIntoViewIfNeeded` on the portalled content is a no-op because
   the portal sits outside the page scroll container. Switching to
   `dispatchEvent('click')` synthesises a click directly on the element
   without any actionability or viewport check; Radix Switch's native
   click handler fires `onCheckedChange` and the PUT lands as expected.

2. charts-mobile.spec.ts — the 30-day-window tick-count assertion times
   out waiting for `.recharts-xAxis .recharts-cartesian-axis-tick text`
   to be visible. Recharts does paint the <text> ticks into the SVG, but
   the chart card on Pixel-5 is taller than the 851-px viewport, so the
   bottom-anchored x-axis labels stay below the fold even after
   `scrollIntoViewIfNeeded` brings the card's top into view. The
   downstream `evaluate` only needs the ticks attached to the DOM (it
   counts them via querySelectorAll), so `state: 'attached'` is both
   sufficient and viewport-tolerant.

Neither fix changes the assertion semantics — both still exercise the
same user-visible behaviour against the same selectors. The CI mailer
should fall silent after the next push.
2026-05-14 11:54:44 +02:00
..