Repository navigation
test(llms-txt): assert the gate's section and chip fallbacks and clear its coverage-floor entry - #304
Conversation
…r its coverage-floor entry sectionByHeading returned null for a heading id with no enclosing or unclosed <section>, and chipsIn skipped chip-less <li>s and read a logo-only chip's note as empty, but no fixture asserted any of the three. Pin them so a future edit that slices from index -1 or passes the chip name through as its note fails here, and delete the llms-txt.test.mjs entry from TEST_HELPER_BASELINE now that it carries no dead ranges. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Read the helpers the new test pins (scripts/llms-txt.test.mjs:63-85, same file as the test). Each assertion matches the code path it claims to cover: lastIndexOf("<section", h) returns -1 for the <div>-wrapped heading and indexOf("</section>") returns -1 for the unclosed one, so both hit the return null at line 68; the <em> item has no integration-chip span and hits continue at line 78; the bare-image chip's only span is filtered by the <img test at line 81, so spans[spans.length - 1] ?? "" yields "". Ran node --test scripts/llms-txt.test.mjs scripts/coverage-floor.test.mjs at 5dd6f9f: 31/31 pass, including the ratchet with the llms-txt.test.mjs baseline entry removed. Looks correct to me.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Looks correct to me — read the helpers and ran the gates locally at 5dd6f9f.
|
Test Improvement
scripts/llms-txt.test.mjscarried the last 3 dead ranges allowed byTEST_HELPER_BASELINEincoverage-floor.test.mjs:sectionByHeading→return nullwhen the heading id exists but no<section>opens before it (or none closes after it)chipsIn→continuefor an<li>that has nointegration-chipspanchipsIn→?? ""when a chip's only span is the logo<img>and there is no noteNone was asserted, so an edit that sliced from index
-1or passed the chip name through as its note would still pass the suite. One fixture test now pins all three, and thellms-txt.test.mjsentry is deleted fromTEST_HELPER_BASELINE(the ratchet reported0 dead ranges left … delete the entryafter the test landed and before the baseline edit).Evidence at
0ed46c8:node --test scripts/*.test.mjs→ 801/801 pass (was 800);scripts/check-links.test.sh125/125;scripts/check-redirects.test.sh32/32. No helper or page code changes.Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88