Repository navigation
test: cover the RadarReports render and its outbound-link contract - #458
Merged
Merged
Conversation
src/components/RadarReports/index.js renders the whole /reports page from data/radar-reports.json and was loaded by no test at all: it did not appear in the node --test --experimental-test-coverage report. scripts/validate-radar-reports.mjs guards the shape of the corpus, but nothing guarded the rendering. Assert the rendered element tree against the checked-in corpus: the labelled landmark, one uniquely keyed <li> per report, each title anchor's href and text, the summary, the long en-US publishedAt date, the provenance line's sourceUrl and generatedAt, and that every outbound anchor pairs target="_blank" with rel="noreferrer" so the page cannot leak window.opener. Signed-off-by: kubestellar-hive[bot] <kubestellar-hive@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 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/radar-reports.test.mjs, the first test to loadsrc/components/RadarReports/index.js. That component renders the whole/reportspage from the mirroreddata/radar-reports.jsoncorpus and was absent from thenode --test --experimental-test-coveragetable entirely — no test imported it.scripts/validate-radar-reports.mjsguards the shape of the corpus; nothing guarded the rendering. The new test uses the existing JSX harness (tests/helpers-jsx.mjs+tests/tools/react-element-tree.mjs, same pattern astests/cncf-project-card.test.mjs) and asserts the rendered element tree:<section aria-label="CNCF Technology Radar reports"><li>per entry indata.radarReports, each with a unique React keyurland renders itstitlepublishedAtrenders as a longen-USdateMirrored from …) linksdata.sourceUrland rendersdata.generatedAttarget="_blank"withrelcontainingnoreferrer, so the page cannot leakwindow.opener<SyncStatus />is a nested component element, so the element-tree walker yields it without descending; the test invokes it to render that subtree.Result
src/components/RadarReports/index.jsgoes from absent from the coverage table to 100.00% lines / 100.00% funcs / 66.67% branches. Full suite: 604 tests, 0 failures (npm run test:unit -- --experimental-test-coverage, node v26.8.2).The two remaining branches (
!data.generatedAt, a report with nopublishedAt) need a different corpus, and the component reads it through the@sitealias at module scope, so they are not reachable without fixture injection. They are called out as out of scope in #457.Verification
Mutation-checked: removing
rel="noreferrer"from the report title anchor turns the outbound-link test red and leaves the other seven green.Related Issue
Closes #457
Scope
Touches exactly one new file,
tests/radar-reports.test.mjs. No production code, no shared harness changes — in particular it does not touchtests/tools/react-hook-driver.mjs(claimed by #435) and is disjoint from #443 (MetricsDashboard), #453 (AwardsTimeline), #446 (check-community-group-links), #437/#439 (collect-launch-metrics), #225 (fixture-sandbox coverage) and #413 (MemberDirectory).Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5