Skip to content

[quality] add unit tests for sitemap.ts, proxy.ts, robots.ts (0% -> covered) - #53

Closed
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-sitemap-proxy-robots
Closed

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-sitemap-proxy-robots

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds 17 unit tests for three previously-untested (0% coverage) route-level modules:

  • src/__tests__/sitemap.test.ts (8 tests) — exercises src/app/sitemap.ts against a temp fixture tree via a process.cwd() spy: homepage//en//docs entries, per-tier priorities (1.0/0.8/0.9/0.7) and change frequencies, project root entries for all 7 projects, extension stripping and /index collapsing, exclusion rules (_-prefixed files/dirs, hidden dirs, node_modules, common-subs, images, non-markdown), file-mtime lastModified, and missing-content-root fallback.
  • src/__tests__/proxy.test.ts (7 tests) — exercises src/proxy.ts with mocked next/server and next-intl/middleware: 307 redirects for /es/docs/*, /pt-BR/docs/*, /SC/docs/*, root→/docs, delegation to the i18n middleware for other paths, non-locale prefixes left alone, and matcher config shape.
  • src/__tests__/robots.test.ts (2 tests) — src/app/robots.ts rules and sitemap URL.

No production code changed. Full suite: 58 files / 530 tests pass; npm run lint 0 errors; tsc --noEmit clean.

Related Issue

Closes #52


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.88

sitemap.ts (SEO-critical route generation), proxy.ts (locale redirect
middleware), and robots.ts had 0% coverage. Adds 17 tests covering
markdown discovery/exclusion rules, route mapping, priorities and
change frequencies, locale->docs 307 redirects (xx, xx-YY, SC), root
redirect, i18n delegation, and robots directives.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review 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. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for hivecommons-docs ready!

Name Link
🔨 Latest commit 32197c0
🔍 Latest deploy log https://app.netlify.com/projects/hivecommons-docs/deploys/6ab5bbdaaffd51000864789e
😎 Deploy Preview https://deploy-preview-53--hivecommons-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubestellar-prow

Copy link
Copy Markdown

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

clubanderson added a commit that referenced this pull request Sep 25, 2026
Port the useful coverage from docs PRs #50 and #53 on top of the current docs main branch.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@clubanderson

Copy link
Copy Markdown
Member

Closing as superseded by #55, which merged the non-redundant route coverage from this PR on top of the current docs main branch. The rest of this PR's sitemap/proxy/robots coverage was already covered by #54.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] sitemap.ts, proxy.ts, robots.ts have 0% test coverage (SEO-critical route generation untested)

1 participant