[quality] CaseStudies' undated-study comparator fallbacks have no end-to-end coverage
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- testing-qa
Research direction
Read src/components/CaseStudies/index.js, tests/tools/e2e-data-fixtures.cjs, and tests/e2e/case-studies.spec.js to understand the comparator, additive overlays, and existing assertions. Add two undated studies to the coverage fixture and extend the end-to-end test. Done when both rows render with empty date cells, sort last, dated rows retain formatted dates, and region line 25 is covered.
Written by the indexing model from the issue text.
Description
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.jsis at 92.98%
regions, uncovered region lines[25, 46, 64]. Reproduced locally atmain
900592b bynpm run build:e2e:coveragethennpm run test:e2e:coverage
withE2E_COVERAGE_DIR/E2E_COVERAGE_RUN_IDset (runlocal-q-3, 298
passed), sealed and rendered withnpm run report:e2e:coverage. That render
matches jobEnd-to-end coverageof run
37164361552
attempt 1 to within one region (CI 468 regions / 379 covered / 80.98%;
local 467 / 378 / 80.94%), andCaseStudiesis identical in both. - Unit:
TZ=UTC node tests/tools/coverage-report.mjsat the same revision
reportssrc filesat 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.jsasserts the empty date cell and the sort position - Region line 25 no longer appears in the
End-to-end coveragereport forCaseStudies
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
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 2
- Avg merge
- 22h 21m
- Merged PRs (30d)
- 404
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cncf/endusers
-
agent/scanner bug hive/hosted-available-lke648397-260827-5n31
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
[quality] the member-dialog logo-less e2e case reads data/members.json, so a landscape refresh can silently retire itPossibly taken @hivecommons-hive claimed this today. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
agent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
Similar issues
-
Bug pulumi/pulumi
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
andromarces/agent-loops#571 ·
Maintainers usually reply within 1 day
-
Code Cleanup Dev Environment
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ProjectSidewalk/SidewalkWebpage#5699 ·
Maintainers usually reply within 1 day
-
automated issue report
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
lirantal/discoprint#38 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
zenstackhq/zenstack#2873 ·
Maintainers usually reply within 1 day