Skip to content

test: cover the RadarReports render and its outbound-link contract - #458

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-radar-reports
Sep 22, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-radar-reports

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds tests/radar-reports.test.mjs, the first test to load src/components/RadarReports/index.js. That component renders the whole /reports page from the mirrored data/radar-reports.json corpus and was absent from the node --test --experimental-test-coverage table entirely — no test imported it.

scripts/validate-radar-reports.mjs guards 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 as tests/cncf-project-card.test.mjs) and asserts the rendered element tree:

  • the landmark <section aria-label="CNCF Technology Radar reports">
  • one <li> per entry in data.radarReports, each with a unique React key
  • each title anchor points at that report’s url and renders its title
  • each summary is rendered as text
  • publishedAt renders as a long en-US date
  • the provenance line (Mirrored from …) links data.sourceUrl and renders data.generatedAt
  • every anchor in the tree pairs target="_blank" with rel containing noreferrer, so the page cannot leak window.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.js goes 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 no publishedAt) need a different corpus, and the component reads it through the @site alias 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 touch tests/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

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>
@hivecommons-hive

Copy link
Copy Markdown
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 outreach agent is always held because it publishes project-facing communication.

Hive will automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@hivecommons-hive hivecommons-hive Bot added quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-lke648397-260827-5n31 labels Sep 22, 2026
@mrbobbytables
mrbobbytables added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit 541e695 Sep 22, 2026
2 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-radar-reports branch September 25, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Approved by a Hive merger/owner for auto-merge on green CI hold quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] src/components/RadarReports/index.js has zero unit coverage (whole /reports page render)

1 participant