Repository navigation
test: guard the member directory freshness note end to end - #1075
Merged
Merged
Conversation
/community/members renders DirectoryFreshness, whose three sentences each come from a different scheduled data file and each sit behind a && on their own formatDate() result. formatDate() returns null for anything Date cannot parse, so a refresh that writes a malformed timestamp drops that sentence silently; if all three go, the note disappears entirely. tests/member-directory.test.mjs asserts the note through a fake DOM with injected fixtures, so it proves a good timestamp renders but cannot fail when the committed JSON carries a bad one. This adds the end-to-end counterpart, reading data/members.json, data/metrics.json and data/awards.json at run time and asserting what the browser renders from them. The timestamps are asserted rather than used to skip: all three are already required to be parseable upstream, so a value that fails the check is the regression itself and skipping on it would hide the failure this spec exists to catch. Verified by mutating data/awards.json verifiedAt to an unparseable value and rebuilding: the award sentence vanishes from the rendered note and the new case fails, while every other spec stays green. Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
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. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Improvement
Adds
tests/e2e/member-directory-freshness.spec.js, an end-to-end guard forthe provenance note at the top of
/community/members(
src/components/MemberDirectory/DirectoryFreshness.js).The note's three sentences each come from a different scheduled data file, and
each sits behind a
&&on its ownformatDate()result:data/members.jsonsources.landscape.collectedAtdata/metrics.jsongeneratedAtdata/awards.jsonverifiedAtformatDate()returnsnullfor anythingDatecannot parse, so a refreshthat writes a malformed timestamp drops that sentence silently; if all
three go,
DirectoryFreshnessreturnsnulland the note disappears.Five cases: the note renders exactly once, each of the three sentences is
present, and the two named sources (
cncf/landscape,cncf/architecture)resolve to the absolute
https://URL the data carries and open in a new tabwith
rel="noreferrer".Why the existing tests do not cover this
tests/member-directory.test.mjs:367and:420already assert the note, butthrough
tests/tools/fake-dom.mjswith injected fixtures. They prove thata good timestamp renders; they never read the committed JSON, so they cannot
fail when a scheduled refresh writes a bad one. These files change with no
source change at all, which is the case the unit suite is blind to. The
repository already applies this reasoning to the analogous
PeopleFreshnessnote at
tests/e2e/community-people.spec.js:116-122.Asserted, not skipped
Each timestamp is asserted rather than used as a
test.skipcondition. Allthree are already required to be parseable upstream —
scripts/validate-enduser-members.mjs:91,scripts/validate-metrics.mjs:76and
scripts/validate-awards.mjs:51— so a value that fails the check is theregression, and skipping on it would hide exactly the failure this spec exists
to catch.
Verification
Run locally at
900592bagainstnpm run build:production, chromium, nodev26.10.0: 5 passed.
Then
data/awards.jsonverifiedAtwas set to"not-a-date"and the siterebuilt. The rendered note became
— the award sentence gone, with no other symptom — and the new case failed with
data/awards.json verifiedAt must be a parseable timestampwhile the otherfour stayed green.
data/awards.jsonwas restored; this PR changes no data.npx prettier --checkandnpx eslintpass on the new file.Scope and coordination
One new spec file; nothing else is touched. Deliberately not
tests/e2e/member-directory.spec.js(open PR #1060, the directory's fourundriven toolbar controls) or
tests/e2e/interactions.spec.js(open PR #1058,the industry and CNCF-project facet selects). No overlap with the e2e coverage
tooling PRs (#1040, #1051, #1070, #1072), and this is not a coverage-gap fix:
the note already renders on every visit, so its regions are counted covered —
what was missing is any assertion.
Related Issue
Closes #1074
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88