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"]); });