Skip to content

test: add docs navigation route consistency test#188

Open
VarshithaChettipalli wants to merge 2 commits into
AnkanMisra:mainfrom
VarshithaChettipalli:issue-176-doc-route-test
Open

test: add docs navigation route consistency test#188
VarshithaChettipalli wants to merge 2 commits into
AnkanMisra:mainfrom
VarshithaChettipalli:issue-176-doc-route-test

Conversation

@VarshithaChettipalli
Copy link
Copy Markdown

@VarshithaChettipalli VarshithaChettipalli commented May 30, 2026

Summary

Adds a test that verifies docs navigation routes stay synchronized with the actual docs pages in src/app/docs.

The test reads the filesystem, filters out page.mdx and layout.tsx, generates expected routes, and compares them with DOCS_NAV_ITEMS.

Type Of Change

  • Bug fix
  • Feature
  • Documentation
  • [ x] Tests
  • Refactor
  • Deployment/config

Affected Areas

  • Gateway (gateway/)
  • Verifier (verifier/)
  • [ x] Web (web/)
  • E2E/tests (tests/, run_e2e.sh)
  • Benchmarks (bench/)
  • Deployment/config (deploy/, Docker, env, workflows)
  • Documentation/community files

Contributor Checklist

  • [x ] I kept the change focused and avoided unrelated refactors.
  • I updated README/service docs/OpenAPI/env examples when behavior, config, headers, status codes, or public APIs changed.
  • [ x] I did not commit secrets, private keys, funded wallets, API keys, or real production URLs.
  • I checked x402/EIP-712 field parity when touching payment context, signatures, timestamps, nonces, chain IDs, receipts, or wallet flow.
  • I checked Docker/Compose/Fly/Vercel docs when touching ports, service names, health checks, or environment variables.

Verification

cd web
bun test

Result:
36 pass
0 fail
Ran 36 tests across 3 files

Fixes #176

Summary by CodeRabbit

  • Tests
    • Added test validating that documentation navigation items correspond to the expected filesystem routes.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

@VarshithaChettipalli is attempting to deploy a commit to the ankanmisra's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2026

Warning

Review limit reached

@VarshithaChettipalli, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 57 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 44608b02-036f-46ac-b16f-6ce3679ee8dd

📥 Commits

Reviewing files that changed from the base of the PR and between e08e415 and 27b704b.

📒 Files selected for processing (1)
  • web/src/components/docs/docs-nav.test.ts
📝 Walkthrough

Walkthrough

Adds a test to docs-nav.test.ts that synchronizes the documentation navigation items with the actual docs pages on the filesystem. The test enumerates docs pages from ./src/app/docs, derives expected route paths, and asserts they match the hrefs produced by DOCS_NAV_ITEMS.

Changes

Docs Navigation Synchronization Test

Layer / File(s) Summary
Docs filesystem-to-navigation alignment test
web/src/components/docs/docs-nav.test.ts
Adds readdirSync import and a new test that reads the docs directory, filters out system files (page.mdx, layout.tsx), derives expected /docs/<entry> routes, and verifies they match DOCS_NAV_ITEMS hrefs (excluding /docs) in sorted order.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

📚 A rabbit hops through docs with glee,
Checking that all the pages agree!
When files and nav both stay in line,
The documentation shines so fine. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a test for docs navigation route consistency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description follows the template with clear summary, correct type of change (Tests), appropriate affected area (Web), completed contributor checklist, and verification commands with results.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/src/components/docs/docs-nav.test.ts`:
- Around line 24-33: The test "keeps docs navigation routes in sync with docs
pages" currently treats any file in docs/ as a route; update the
docsEntries/docsRoutes creation to only include actual route directories by
checking filesystem metadata and/or the presence of a page file: use
readdirSync(...) to list entries, then for each entry call statSync or lstatSync
and include only entries where isDirectory() is true and a route page exists
(e.g., check existsSync(join("./src/app/docs", entry, "page.mdx")) or
"page.tsx"); adjust the filter/map that builds docsRoutes to use these checks so
only real Next.js app router directories are turned into `/docs/${entry}`
routes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d3c231f4-16de-43cf-bc11-29f4039bc620

📥 Commits

Reviewing files that changed from the base of the PR and between 8985ec7 and e08e415.

📒 Files selected for processing (1)
  • web/src/components/docs/docs-nav.test.ts

Comment thread web/src/components/docs/docs-nav.test.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a web docs navigation route consistency test

1 participant