Repository navigation
test: cover reference-style cross-plugin link rewriting in e2e suite - #434
Conversation
e2e/linkRewrite.test.mjs asserted cross-plugin .md rewriting only via an inline link (keda/analysis.md), which exercises the remark plugin's link-node visitor. Reference-style links ([text][ref] resolved through a separate [ref]: url definition, as litmuschaos/analysis.md uses) are resolved via a separate definition-node visitor and were unit-tested in isolation but never asserted against a real build, so a regression confined to that branch would have passed the full e2e suite. Verified by temporarily dropping 'definition' from the plugin's visit() node-type list: every existing e2e assertion still passed, and only the new assertion failed. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: clubanderson <407614+clubanderson@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 plugin and the tree, not just the diff - this looks correct to me.
lib/remarkRewriteLinks/index.ts:141visits['link', 'image', 'definition'], andanalyses/2024/litmuschaos/analysis.md:715really does carry the reference-style definition[criteria]: ../../docs/analysis/criteria.md, used via[criteria]references - so this assertion exercises thedefinitionbranch against a real build, which the existing keda assertion (inlinelinknode,e2e/linkRewrite.test.mjs:48-51) does not.- The expected rewrite is right:
../../docs/analysis/criteria.mdmatchesCROSS_PLUGIN_RE, gets mapped site-absolute,.mdstripped, trailing/appended ->/docs/analysis/criteria/. - The output path
analyses/2024/litmuschaos/analysis/index.htmlfollows the same route shape as the adjacent keda assertion.
The claimed verification method (temporarily dropping definition from the visitor list and watching only the new assertion fail) is exactly the right mutation test for this gap. One-file, 18-line, test-only addition; no concerns.
-- hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues with the added reference-style cross-plugin link rewriting coverage.
No open issues 🎉
What changed in this PR
Adds end-to-end coverage for reference-style cross-plugin link rewriting, addressing #433 without changing production code.
Changes:
- Checks that the built litmuschaos analysis page links to
/docs/analysis/criteria/. - Documents how this assertion complements the existing inline-link test by exercising the remark plugin’s
definitionvisitor.
| File | Description |
|---|---|
e2e/linkRewrite.test.mjs |
Adds a reference-style link assertion against real build output and explains its coverage purpose. |
Review effort: Balanced
Test Improvement
e2e/linkRewrite.test.mjsasserts cross-plugin.mdlink rewriting onlyvia an inline link (
analyses/2024/keda/analysis.md's[criteria](../../docs/analysis/criteria.md), alinkmdast node).lib/remarkRewriteLinks/index.ts's remark plugin also visitsdefinitionnodes, which resolve reference-style links ([criteria]via a separate
[criteria]: ../../docs/analysis/criteria.mdline, asused in
analyses/2024/litmuschaos/analysis.md). That branch wasunit-tested in isolation (
lib/remarkRewriteLinks/index.test.mts) butnever asserted against the real
docusaurus buildoutput, so aregression confined to the
definitionvisitor would have passed thefull e2e suite silently.
This PR adds one assertion against the litmuschaos page's rendered href,
alongside the existing keda assertion. Verified the gap and the fix: with
definitiontemporarily dropped from the plugin's node-type list, everypre-existing e2e assertion still passed and only the new one failed;
restoring the plugin makes the full suite (
npm run test:e2e) andcoverage gate (
npm run test:coverage, 100/100/100/100) pass again.Related Issue
Fixes #433
Filed by quality agent (hold-gated mode). Human review required.
-- hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88