Repository navigation
test: pin the variant epoch date to formatDate's UTC rendering - #1650
Conversation
EPOCH_DATE in tests/e2e/member-directory-freshness-variant.spec.js accepted "December 31, 1969" as well as "January 1, 1970", on the stated premise that nothing pins TZ for the Playwright run. src/components/shared/formatDate.js formats with timeZone: 'UTC', so the browser's zone never enters into it and formatDate(null) is January 1, 1970 in every zone. tests/format-date.test.mjs already asserts that by value. The accepted 1969 arm is therefore dead, and is also exactly what deleting the timeZone: 'UTC' option renders west of UTC -- the regression formatDate's own docblock says the pin exists to prevent. Neither coverage lane can see that deletion, since it executes the identical lines and regions, so this assertion was the one placed to witness it in a browser and was written to accept it. Correct the same false premise where it is restated, in the data-variant overlay description and in tests/e2e-data-fixtures.test.mjs. Verified against the committed variant build rather than inferred: the prerendered build/e2e-coverage-variant/community/members/index.html carries "January 1, 1970" twice and "December 31, 1969" not at all. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
✅ Deploy Preview for endusers ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
mrbobbytables
left a comment
There was a problem hiding this comment.
Reviewed the diff and current required checks; approved in the requested merge order. Hold released per explicit maintainer instruction.
Test Improvement
Tightens
EPOCH_DATEintests/e2e/member-directory-freshness-variant.spec.jsfrom
/December 31, 1969|January 1, 1970/to/January 1, 1970/, and correctsthe premise behind it where it is restated in
tests/e2e/fixtures/data-variant/community-people.json(overlaydescription)and
tests/e2e-data-fixtures.test.mjs.The spec justified the alternation with "nothing pins TZ for the Playwright
run, and 0ms is the last day of 1969 west of UTC". But
src/components/shared/formatDate.jsformats withtimeZone: 'UTC', so thebrowser's zone never enters into it:
formatDate(null)isJanuary 1, 1970inevery zone, which
tests/format-date.test.mjsalready asserts by value acrossLos Angeles, Berlin and Kiritimati.
So the
December 31, 1969arm was not caution. It is dead, and it is exactlywhat deleting the
timeZone: 'UTC'option renders west of UTC — the regressionformatDate's own docblock says the pin exists to prevent. Neither coveragelane can see that deletion, because it executes the identical lines and
regions; a by-value assertion is the only thing that can. This spec was the one
positioned to witness it in a browser, and was written to accept its output.
No production code changes. Files touched: the three named above only —
disjoint from the open held PRs (#1628 composite action, #1638
SECURITY.md,#1648
GOVERNANCE.md, #1636tests/e2e-coverage-build-reach.test.mjs).Verification
Rendered output rather than inference.
npm run build:e2e:coverageat65f64be(exit 0), then reading the prerenderedbuild/e2e-coverage-variant/community/members/index.html:January 1, 1970December 31, 1969Directory membership data last syncedInvalid DateThe real
/community/membersroute still carries the membership sentence (1occurrence), so both arms of the spec's pair still hold.
Also run locally:
TZ=UTC node --test tests/e2e-data-fixtures.test.mjs tests/format-date.test.mjs— 45 pass, 0 fail.npx playwright test --list tests/e2e/member-directory-freshness-variant.spec.js— 2 tests enumerated.npm run check:duplication— ok, 270 clones against ceiling 270.npx prettier --checkon all three changed files — clean.formatDate(null)evaluated directly underTZ=UTC,America/Los_Angeles,Pacific/Honolulu,Asia/Tokyo—January 1, 1970in all four.The spec itself was not executed in a browser here: this host's Chromium cannot
launch (
exitCode=127, no root forplaywright install-deps), so theassertions were verified against the prerendered HTML the browser would have
been served. The
End-to-end coveragejob runs it for real.Related Issue
Closes #1649
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88