Repository navigation
test: cover RadarReports missing-corpus fallback branches - #532
Merged
Merged
Conversation
data/radar-reports.json always has generatedAt, a non-empty radarReports array and a publishedAt on every report, so the three fallback arms in src/components/RadarReports/index.js were unreachable and the file sat at 66.67% branch coverage. Patch the shared corpus module object around a single render and restore it in a finally, so the assertions land on the real source file rather than a rewritten copy. Branch coverage is now 100.00%. 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 |
4 tasks
This was referenced Sep 23, 2026
mrbobbytables
approved these changes
Sep 23, 2026
mrbobbytables
left a comment
Member
There was a problem hiding this comment.
Reviewed against current main: applies cleanly, targeted and full suites pass (TZ=UTC), prettier clean. Removing hold and merging per maintainer request.
mrbobbytables
enabled auto-merge
September 23, 2026 20:42
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
src/components/RadarReports/index.jsrenders the whole/reportspage andmeasured 100.00% lines but 66.67% branches. Every uncovered arm is a
missing-or-empty-corpus fallback, and
data/radar-reports.jsoncan never reachany of them: it has
generatedAtset, six reports, and apublishedAton everyone.
This adds three tests to
tests/radar-reports.test.mjscovering the three armsnamed in the issue:
SyncStatus'sif (!data.generatedAt) return null;— no provenance line.const radarReports = data.radarReports || [];— the[]fallback, assertedboth for an absent key and for an empty array; the
<ul>itself still renders.{report.publishedAt && (...)}— an undated report renders no date row, onlyits summary paragraph.
No source file is modified.
Coverage
TZ=UTC node --test --experimental-test-coverage --test-coverage-include='src/components/RadarReports/**' tests/radar-reports.test.mjs, Node v26.8.2, atc154bd5:src/components/RadarReports/index.jsBefore this branch the same command reported
100.00 / 66.67 / 100.00, with 8tests; it now runs 11.
npm run test:uniton the branch: 914 tests, 911 pass, 0 fail, 3 todo. Thethree
todoentries are pre-existing and untouched here.Why not
tests/helpers-component-data.mjsThe issue expected #482's
importWithData, which is now merged. It isdeliberately not used: it imports a rewritten copy of the source into a temp
directory, so the copy's coverage is attributed to that temp file and the three
branches would have stayed red on the real one — the opposite of what the issue
asks for.
Instead the test imports
data/radar-reports.jsonthroughimportSource, whichresolves to the same module URL the component's
@site/data/radar-reports.jsonspecifier resolves to, so it holds the very object the component reads. A
withCorpus(patch, run)helper applies a patch around a single render andrestores every key in a
finally— present with its old value, or absent — sothe order the tests run in cannot matter. This is the same approach
tests/community-people.test.mjsand #529 use.Related Issue
Closes #506
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88