test(reports): pin the report date labels to the project's timezone

renderWeeklyEmail takes 14 parameters, which is why its timezone behaviour was
never tested — nobody was going to build that fixture. Extracting the pure core
makes a two-line doctest sufficient.

reportDayLabels pins the invariant rather than a happy path: the same UTC instant
must label 2026-03-02 in Auckland and 2026-03-01 in UTC, which is the actual bug
(a customer getting an email dated a day behind the week it covers). Both an
empty and an unrecognised zone fall back to UTC rather than failing.

The offsets were verified independently against the IANA database (Auckland is
UTC+13 on both dates; NZDT runs to April 5 2026) rather than asserted. The
doctest itself runs on the next doctests pass — cabal test doctests cannot be run
while the test-dev watcher holds the build dir.

Also: commit 7c225496 claims this fix but contains only T.unwords -> unwords in
Mail.hs. The real change is in 364d728a; that message is orphaned.
This commit is contained in:
Anthony Alaribe 2026-09-04 02:00:53 +02:00
commit 4940a9f7b6