Skip to content

[quality] CaseStudies' two empty-corpus arms (lines 46, 64) have no end-to-end coverage #1132

Description

@hivecommons-hive

Finding

src/components/CaseStudies/index.js branches on two document-level fields of
data/case-studies.json, and neither arm is reachable in the browser against
the data the site ships:

45 function SyncStatus() {
46   if (!data.generatedAt) return null;            // uncovered: no provenance line
...
63 export default function CaseStudies() {
64   const caseStudies = data.caseStudies || [];    // uncovered: the `|| []` fallback

The checked-in corpus always carries a generatedAt and a full table of
studies. Both arms are ordinary shapes rather than defensive dead code: the
file is regenerated by npm run collect:case-studies
(scripts/collect-case-studies.mjs) against cncf.io, so a collector run that
fetches nothing is exactly what produces them. || [] is load-bearing — the
list is immediately handed to sortByPublishedAtDesc, filterCaseStudies,
.length and .map, so without it the page throws rather than degrades.

Evidence and provenance

  • Unit — covered. npm run test:unit:coverage
    (TZ=UTC node tests/tools/coverage-report.mjs, node v26.10.0) run locally on
    2026-10-06 at main = 7ab301e reports src files | 100.00 | 99.96 | 8721/8721 lines | 2475/2476 regions, with scripts/lib/svg-active-content.mjs
    line 251 the only sub-100% source row. src/components/CaseStudies/index.js
    is at 100%.
  • E2E — not covered. CI artifact e2e-coverage, id 11383321728, from the
    merge-queue run on main at 7ab301e, workflow Validate repository, job
    End-to-end coverage. report.txt:
    src/components/CaseStudies/index.js | 100.00 | 96.55 | | 46 64.
  • Covered by unit tests but not end-to-end tests, so priority 2 under the
    coverage-evidence rules.

Why a variant build and not the additive overlay

tests/e2e/fixtures/data/case-studies.json already patches this same component
additively — it appends two undated studies so sortByPublishedAtDesc's
|| '' arms and the empty date cell render beside the real rows. These two
arms are the opposite shape: both fields are document-level on the one file the
one /resources/case-studies page reads, so clearing them in the ordinary
coverage build would trade the provenance line and all 215 rows — those two
appended fixture rows included — for them, swapping which arm is covered rather
than adding a case.

So they belong to the variant build, exactly as RadarReports' empty-corpus
arms (#1097, landed in #1098) and AwardsTimeline's provenance paragraph do.

Verified locally at 7ab301e

npm run build:e2e:coverage with the overlay below renders both arms:

build/resources/case-studies/ build/e2e-coverage-variant/resources/case-studies/
Mirrored from provenance line 1 0
<th scope=row> rows 215 0
results bar Showing 215 of 215 Showing 0 of 0
No case studies match those filters. absent present
<option> elements in the three selects 154 3 (one All … each)

Recommendation

  • tests/e2e/fixtures/data-variants/case-studies.json clears generatedAt
    and caseStudies, and a spec pairs /resources/case-studies with
    /e2e-coverage-variant/resources/case-studies, asserting the provenance
    line and every row on the first and neither on the second
  • src/components/CaseStudies/index.js lines 46 and 64 leave the
    uncovered-region list

The first box is what the PR below lands. The second is not reachable from
a fixture: getRegionCoverage in tests/tools/e2e-coverage-report.mjs keys a
region on its exact original line:column:endLine:endColumn, and the two
builds' generated code maps back to different coordinates, so the union keeps
the real build's zeros. That was measured on this identical shape in #1097 and
is tracked as #1066 / #1079. Once the union folds the coordinates, these two
arms fold with no further change.

Coordination

The change touches only tests/e2e/fixtures/data-variants/case-studies.json
(new) and tests/e2e/case-studies-variant.spec.js (new). It does not edit
tests/e2e-data-fixtures.test.mjs (occupied by #1110 and #1113),
tests/e2e/data-variants.spec.js, tests/e2e/data-fixtures.spec.js or
tests/tools/e2e-data-fixtures.cjs (occupied by #1110),
tests/e2e/fixtures/data-variants/metrics.json (occupied by #1117), or
tests/e2e/fixtures/data/case-studies.json. The cases lists in
tests/e2e-data-fixtures.test.mjs are hardcoded and not exhaustive, so a new
variant overlay needs no edit there — the existing "every committed overlay
still applies to its data file" case picks it up, and it passes. A separate
spec file follows #1098's precedent. No workflow file is involved: the CI gate
is --check-source-regions 80 (.github/workflows/ci.yml:233), which only
rises.

src/components/CaseStudies/index.js is named by no open PR.

Priority

  • Impact: medium (the largest data table the site ships, regenerated from an
    external source, whose empty-corpus rendering is untested in the shipped
    bundle; 2 of the e2e report's 40 uncovered regions)
  • Effort: low

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: 7ab301e

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

Activity

  1. added
    qualityApproved by a Hive merger/owner for auto-merge on green CI
    testingApproved by a Hive merger/owner for auto-merge on green CI
    agent/qualityApproved by a Hive merger/owner for auto-merge on green CI
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 6, 2026
  2. added a commit that references this issue on Oct 8, 2026
    47c1e9c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityApproved by a Hive merger/owner for auto-merge on green CIhive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5n31Approved by a Hive merger/owner for auto-merge on green CIqualityApproved by a Hive merger/owner for auto-merge on green CItestingApproved by a Hive merger/owner for auto-merge on green CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions