Repository navigation
test(guides): validate internal links and guide anchors - #435
Merged
anurag629 merged 1 commit intoOct 30, 2026
Merged
Conversation
anurag629
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Adds an automated guard against broken internal links in guide TSX pages.
The test checks literal JSX
hrefvalues against existing page routes and validates guide anchors against literalidattributes. It resolves relative links, handles query strings, skips external URLs and non-page schemes, and reports the source guide, offending link, and failure reason.Closes #432
How I tested this
npx vitest run lib/__tests__/guide-links.test.ts— all 16 tests passed.git diff --check— passed.AI assistance
AI helped implement the regression test and run validation commands.
Type of change
Checklist
npm run lint && npm run test && npm run buildpasses locallylib/and have a test inlib/__tests__/page.tsx, client component,opengraph-image.tsx, and the bug report dropdown are all doneNotes for reviewers
Follows the maintainer’s narrowed scope: a filesystem-based test in
lib/__tests__/for TSX guide pages. It runs through the existingnpm run testcommand and CI configuration.Uses the existing TypeScript dependency to inspect JSX attributes. Dynamic expressions such as
href={related.path}and generated IDs are outside this literal-attribute check.No production code, dependencies, UI, package scripts, or CI configuration changed.