Skip to content

[quality] CaseStudies' undated-study comparator fallbacks have no end-to-end coverage #1064

Description

@hivecommons-hive

Finding

sortByPublishedAtDesc in src/components/CaseStudies/index.js compares two
studies through a fallback on each side:

23  function sortByPublishedAtDesc(caseStudies) {
24    return [...caseStudies].sort((a, b) =>
25      (b.publishedAt || '').localeCompare(a.publishedAt || ''),
26    );

Every one of the 213 studies in data/case-studies.json carries a
publishedAt, so neither || '' arm can run, and the empty arm of the date
cell beside it (line 204) cannot render either:

204                  {study.publishedAt &&
205                    new Date(study.publishedAt).toLocaleDateString('en-US', {

Evidence and provenance

  • End-to-end: src/components/CaseStudies/index.js is at 92.98%
    regions, uncovered region lines [25, 46, 64]. Reproduced locally at main
    900592b by npm run build:e2e:coverage then npm run test:e2e:coverage
    with E2E_COVERAGE_DIR/E2E_COVERAGE_RUN_ID set (run local-q-3, 298
    passed), sealed and rendered with npm run report:e2e:coverage. That render
    matches job End-to-end coverage of run
    37164361552
    attempt 1 to within one region (CI 468 regions / 379 covered / 80.98%;
    local 467 / 378 / 80.94%), and CaseStudies is identical in both.
  • Unit: TZ=UTC node tests/tools/coverage-report.mjs at the same revision
    reports src files at 100.00% lines / 99.84% regions, so this is not a
    unit-coverage gap.

Covered by unit tests but not end to end, so this is a priority 2 gap.

Recommendation

A missing date is a property of a single record, not a cleared document-level
field, so this belongs to the additive overlay mechanism
(tests/e2e/fixtures/data/**, see tests/tools/e2e-data-fixtures.cjs) rather
than to the variant build: the real studies keep rendering exactly as they did
and the undated rows render alongside them, so the arm is added rather than
swapped.

Append two undated studies, not one. A lone undated record only ever lands
on one side of a comparison against the dated ones, which leaves the fallback
on the other side unreached — measured: one undated study moves CaseStudies
to 94.83% with line 25 still listed as uncovered, because line 25 carries two
regions. With two, the pair is also compared against each other and both
fallbacks run.

Then assert in tests/e2e/case-studies.spec.js that the undated rows render
with an empty date cell, sort last, and that the other rows still show a
formatted date.

Measured result of doing exactly that: CaseStudies 92.98% -> 96.55%
(uncovered regions [46, 64]), src files 80.98% -> 81.37%. The result is
unchanged under the region fold proposed in #1051 (87.73% -> 88.37%), so it
does not depend on which of the two lands first.

Lines 46 and 64 (!data.generatedAt and data.caseStudies || []) are
document-level fields and are deliberately not in scope here; they are not
reachable by an additive overlay.

Completion criteria

  • An additive overlay appends undated case studies to the coverage build
  • tests/e2e/case-studies.spec.js asserts the empty date cell and the sort position
  • Region line 25 no longer appears in the End-to-end coverage report for CaseStudies

Priority

  • Impact: medium (a comparator fallback that silently decides row order for any study the upstream feed publishes without a date)
  • Effort: low

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: 900592b

— 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 4, 2026
  2. added
    blocked-on-reporterPaused until the e2e coverage reporter fix (#1079) lands; may be a phantom gap
    on Oct 5, 2026
  3. added a commit that references this issue on Oct 8, 2026
    1734c84
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 CIblocked-on-reporterPaused until the e2e coverage reporter fix (#1079) lands; may be a phantom gaphive/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