From 5dd6f9f42203ede558fb9551a1e43a32e2655777 Mon Sep 17 00:00:00 2001 From: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Fri, 30 Oct 2026 20:26:07 -0400 Subject: [PATCH] test(llms-txt): assert the gate's section and chip fallbacks and clear its coverage-floor entry sectionByHeading returned null for a heading id with no enclosing or unclosed
, and chipsIn skipped chip-less
  • 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> --- scripts/coverage-floor.test.mjs | 1 - scripts/llms-txt.test.mjs | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/coverage-floor.test.mjs b/scripts/coverage-floor.test.mjs index c294f23..72577c6 100644 --- a/scripts/coverage-floor.test.mjs +++ b/scripts/coverage-floor.test.mjs @@ -38,7 +38,6 @@ export const TEST_HELPER_BASELINE = { "scripts/dependabot-config.test.mjs": 9, "scripts/issue-forms.test.mjs": 15, "scripts/jsonld-contract.test.mjs": 14, - "scripts/llms-txt.test.mjs": 3, "scripts/no-js-controls.test.mjs": 5, "scripts/page-404.test.mjs": 5, "scripts/page-images.test.mjs": 19, diff --git a/scripts/llms-txt.test.mjs b/scripts/llms-txt.test.mjs index 9406621..88a4da8 100644 --- a/scripts/llms-txt.test.mjs +++ b/scripts/llms-txt.test.mjs @@ -203,6 +203,29 @@ test("chipsIn reads chip name and trailing note, decoding entities and skipping assert.deepEqual(chipsIn(null), []); }); +test("sectionByHeading needs an enclosing
    ; chipsIn skips chip-less items and reads a bare chip's note as empty", () => { + // The heading id exists but no
    opens before it: the markup moved + // out of a section, so the gate must say "not found" rather than slice from + // index -1 and compare against a bogus fragment. + assert.equal(sectionByHeading('

    Loose

    ', "loose-title"), null); + // ...and the mirror: a section opens but never closes after the heading. + assert.equal(sectionByHeading('

    Open

    ', "open-title"), null); + // An
  • without an integration-chip span (a "more coming" placeholder, a + // divider) is not a chip; a chip whose only span is the logo image has no + // note, so classifier filtering sees "" instead of the chip name. + const section = `
    + +
    `; + assert.deepEqual(chipsIn(section), [ + { name: 'Bare', note: "" }, + { name: "Noted", note: "backend: noted" }, + ]); +}); + test("inferenceChipNames unions engines and gateways but drops classifier chips", () => { assert.deepEqual(inferenceChipNames(FIXTURE_HTML), ["Engine", "Gateway"]); });