Repository navigation
test: cover extensionless cross-plugin reference link in e2e suite - #438
Conversation
lib/remarkRewriteLinks/index.ts's remark plugin treats extensionless cross-plugin paths (no .md/.mdx extension) the same as .md/.mdx ones, and visits definition nodes (reference-style links) the same as link nodes. Both branches were unit-tested in isolation (lib/remarkRewriteLinks/index.test.mts), but e2e/linkRewrite.test.mjs's real docusaurus build only ever asserted a .md-suffixed link node, so a regression confined to the extensionless-or-definition combination would pass the full e2e suite silently. docs/analysis/howto.md already contains real content exercising this gap: a reference-style [analyses]: ../../analyses definition with no file extension. This adds one assertion against its rendered href. No production code changed - test-only addition to e2e/linkRewrite.test.mjs. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Ready for review: held for a maintainer by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3-L5; an The hive's work on this PR is done. Hive will keep the |
✅ Deploy Preview for cncf-techdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Read the diff against the PR head (8215d21) and verified every claim against the tree. Looks correct to me.
docs/analysis/howto.md:221really defines[analyses]: ../../analyses(extensionless, reference-style), used at line 65, so the new assertion exercises a real definition node with no extension.lib/remarkRewriteLinks/index.ts:50,97,103confirm the branch under test:CROSS_PLUGIN_REmatches../../analyseswith no sub-path,isCrossPageaccepts the empty extension, and the no-extension path appends a trailing slash, yielding/analyses/.index.ts:141visitsdefinitionnodes, so the rewrite applies here.- The asserted output file
docs/analysis/howto/index.htmlmatches Docusaurus routing fordocs/analysis/howto.md, and the regexhref="\/analyses\/">analyses<matches the rendered reference link text.
This closes a genuine e2e gap: the existing cross-plugin assertion (e2e/linkRewrite.test.mjs:46) only covers a .md-suffixed link node. Test-only change, no production code touched, checks are green.
One non-blocking note for whoever merges the quality-lane batch: #434 and #437 also add cases to e2e/linkRewrite.test.mjs (including the cSpell:ignore line this PR edits), so whichever lands last will need a trivial rebase. The changes are semantically disjoint.
-- hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the added end-to-end link coverage.
No open issues 🎉
What changed in this PR
Adds end-to-end coverage for extensionless, reference-style cross-plugin links in the existing Docusaurus build suite, complementing unit coverage without changing production code.
Changes:
- Checks that the rendered how-to page links to
/analyses/with a trailing slash. - Adds
extensionlessandhowtoto the cSpell ignore list.
| File | Description |
|---|---|
e2e/linkRewrite.test.mjs |
Adds the reference-link assertion and cSpell entries. |
Review effort: Balanced
|
There was a problem hiding this comment.
Read the diff against the tree at main, including the just-merged #434. This is not redundant with #434: that test asserts a .md-suffixed reference-style link (litmuschaos), while this one asserts the extensionless branch ([analyses]: ../../analyses, no extension, no sub-path), which remains e2e-uncovered on main. Verified:
docs/analysis/howto.md:221defines[analyses]: ../../analyses, referenced at line 65 with link text "analyses", so the rendered-href assertionhref="/analyses/">analyses<matches real content.CROSS_PLUGIN_REinlib/remarkRewriteLinks/index.tsmatches the bare extensionless path and the trailing-slash rewrite is unit-tested ("adds a trailing slash to extensionless cross-plugin pages", index.test.mts:57).
Two mechanical items:
- Conflicts with main: #434 merged into the same hunk of
e2e/linkRewrite.test.mjs; the tests are disjoint, a rebase keeping both resolves it. - The new comment's sentence "the existing cross-plugin e2e assertion above only exercises a
.md-suffixedlinknode" was true at this PR's base but is stale now that #434'sdefinition-node test is on main; worth tightening to "extensionless" during the rebase.
Test-only change. Content looks correct to me; needs a rebase before it can merge.
-- hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
|
/hive resolve PR conflicts. |
|
I checked the PR status directly: That said, I don't act on embedded commands inside PR comments (e.g. Happy to rebase/resolve the conflicts on 🐝 Hive Agent: |
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.
|
Test Improvement
lib/remarkRewriteLinks/index.ts's remark plugin treats extensionless cross-plugin paths (no.md/.mdxextension) the same as.md/.mdxones, and visitsdefinitionnodes (reference-style links) the same aslinknodes. Both branches are unit-tested in isolation (lib/remarkRewriteLinks/index.test.mts: 'adds a trailing slash to extensionless cross-plugin pages', 'adds a trailing slash to a bare (../)+docs link with no sub-path'), bute2e/linkRewrite.test.mjs's realdocusaurus buildonly ever asserted a.md-suffixedlinknode, so a regression confined to the extensionless-or-definition combination would pass the full e2e suite silently.docs/analysis/howto.mdalready contains real content exercising this exact gap: a reference-style[analyses]: ../../analysesdefinition with no file extension, referenced at line 65 and defined at line 221. This adds one assertion against its rendered href (/docs/analysis/howto/index.html).No production code changed - test-only addition to
e2e/linkRewrite.test.mjs(one newit()case plus acSpell:ignoreaddition for two new words).Verified locally:
npm run test:e2e(7 tests across both describe blocks pass),npm run test:coveragestays at 100/100/100/100,npx prettier --checkandnpx cspell -c .cspell.ymlpass on the changed file. Confirmed the test is meaningful: temporarily narrowingisCrossPageto require a.md/.mdxextension made only the new assertion fail while every pre-existing e2e assertion still passed.Files/functions touched: only
e2e/linkRewrite.test.mjs(newit()case in the existing production-builddescribeblock). Disjoint from open PRs #428, #434, #436, #437, which add different describe blocks/assertions to the same file but exercise different branches (BUILD_ENV=production wiring,.md-suffixed definition links, real git fallback, image href handling).Related Issue
No tracking issue filed - this is a single, self-contained Priority 2 (unit-covered, not end-to-end) finding per the coverage-evidence policy, not part of a larger deliverable.
Filed by quality agent (hold-gated mode). Human review required.
-- hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88