Skip to content

test: cover sidebars.ts and sidebarsAnalyses.ts exported config - #432

Merged
nate-double-u merged 3 commits into
mainfrom
quality/test-sidebars-config
Nov 20, 2026
Merged

nate-double-u merged 3 commits into
mainfrom
quality/test-sidebars-config

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

sidebars.ts and sidebarsAnalyses.ts are imported by
docusaurus.config.ts's docs preset and analyses plugin respectively, but
no unit test imported either one. c8's default report mode (the one
npm run test:coverage uses - no --all flag) only instruments files a
test process actually requires, so both files were silently absent from
the coverage report rather than scored 0%, and the 99/97/100 threshold
gate had nothing to fail on. They are exercised end-to-end
(e2e/linkRewrite.test.mjs runs a real docusaurus build that
transitively imports both), so the gap was unit-coverage visibility, not
a reachability gap.

This PR adds:

  • lib/sidebars.test.mts - imports sidebars.ts directly and asserts its
    exported docSidebar shape.
  • lib/sidebarsAnalyses.test.mts - imports sidebarsAnalyses.ts directly
    and asserts its exported analysesSidebar shape.

No production code changes. Files touched: two new test files only.

Verified locally: npm run test:coverage now reports 100% stmts/branch/
func/line for both files (74 tests total, up from 72), and both now appear
in the default (non --all) c8 report where they were previously absent.

Related Issue

No tracking issue: the hive's issue-consolidation logic matched this
finding by component tag (docusaurus.config.ts) into #425,
which covers a different, unrelated gap (deploy-preview e2e wiring).
Clarified on #425 directly rather than mislabeling this PR against it.


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

-- hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88

Both files are imported by docusaurus.config.ts but no unit test ever
imported either one, so c8's default (non --all) test:coverage report
silently omitted them instead of scoring them. Add a direct unit test per
file asserting the exported sidebar shape, so a regression to the
autogenerated docSidebar/analysesSidebar config fails fast in the unit
suite rather than only surfacing in a full Docusaurus build.

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added the ready-for-review Hive's work is done; a maintainer reviews, then removes this label to let it merge. label Nov 19, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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 outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

The hive's work on this PR is done. Hive will keep the ready-for-review label until a maintainer reviews the PR and removes it; it blocks merging the same way hold does. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@netlify

netlify Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cncf-techdocs ready!

Name Link
🔨 Latest commit b8e91a2
🔍 Latest deploy log https://app.netlify.com/projects/cncf-techdocs/deploys/6affa3743e774c23e78b163e
😎 Deploy Preview https://deploy-preview-432--cncf-techdocs.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.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read the tree at head 5c94878, not just the diff. Verified:

  • sidebars.ts:15-17 exports exactly { docSidebar: [{ type: 'autogenerated', dirName: '.' }] } (the tutorialSidebar block is commented out), and sidebarsAnalyses.ts:3-5 exports exactly { analysesSidebar: [{ type: 'autogenerated', dirName: '.' }] } - both assert.deepEqual expectations are correct.
  • package.json:42 globs lib/**/*.test.mts, so both new files are picked up by test:unit and therefore by the c8 coverage run.
  • Ran both tests at this head with node --experimental-strip-types --test: 2/2 pass. The import type lines strip cleanly, so no runtime dependency on the Docusaurus packages.
  • Test-only change, no production code touched; follows the existing lib/*.test.mts pattern and comment style.

One nit, not a defect: the PR body says the gate is 99/97/100, but package.json:39 at this head sets 100 across all four thresholds. Body-only inaccuracy.

Looks correct to me. Human approval still required per repo policy.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the added sidebar configuration tests.

No open issues 🎉

What changed in this PR

Adds unit coverage for the Docusaurus sidebar configuration modules so both appear in default c8 coverage reports. No production code changes.

Changes:

  • Imports both sidebar modules directly in new unit tests.
  • Asserts the exported docSidebar and analysesSidebar autogenerated configurations.
File Description
lib/​sidebarsAnalyses.test.mts Verifies the exported analyses sidebar configuration.
lib/​sidebars.test.mts Verifies the exported documentation sidebar configuration.

Review effort: Balanced

@nate-double-u
nate-double-u enabled auto-merge (squash) November 20, 2026 01:33
@nate-double-u
nate-double-u merged commit fa35040 into main Nov 20, 2026
8 of 9 checks passed
@nate-double-u
nate-double-u deleted the quality/test-sidebars-config branch November 20, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Hive's work is done; a maintainer reviews, then removes this label to let it merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants