test: cover the /community/technical-community-groups generated index end to end - #844
Merged
Merged
Conversation
… end to end /community/technical-community-groups is a Docusaurus generated-index route declared by docs/community/technical-community-groups/_category_.json. It has no source document: the h1, the blurb and one card per leaf doc are synthesised at build time from that JSON and each leaf's frontmatter. Nothing on disk holds the result, so no unit test can assert it, and no e2e spec loaded the route. At main the string technical-community-groups did not appear anywhere under tests/. Adds tests/e2e/technical-community-groups.spec.js, driven from _category_.json and the leaf frontmatter so a newly added TCG is covered on arrival. Closes #843 Signed-off-by: hivecommons-hive[bot] <hivecommons-hive@hive.kubestellar.io>
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 Hive will automatically remove the |
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.
Test Improvement
Adds
tests/e2e/technical-community-groups.spec.js— the only file this PRtouches.
/community/technical-community-groupsis a generated-index route:docs/community/technical-community-groups/_category_.jsondeclareslink.type: "generated-index", so the page has no source document. Docusaurussynthesises the
<h1>and the blurb from that JSON, and one card per doc inthe directory from each doc's frontmatter
title,descriptionandslug.Because nothing on disk holds the rendered result, no unit test can assert it —
and no e2e spec loaded it. At
main@7772dcfthe stringtechnical-community-groupsdid not appear anywhere undertests/.npm run test:unit:coveragecannot see the gap either: it reportssrc files | 99.84 | 98.46 | 6329/6339 lineswhile this route is entirelyunexercised, because a generated index contributes no executable source lines
of its own.
The route is not incidental —
docs/community/index.md:30and:87anddocs/community/technical-advisory-board.md:15all link to it as the way avisitor finds a topic group. Moving a doc out of the directory, renaming a
slug, or dropping a frontmatterdescriptionwould empty or mislabel thepage while every existing test stayed green.
The 8 tests assert that:
docusaurus serveanswers an unknown path with the 404 page<h1>and the header blurb are thelink.title/link.descriptionfrom
_category_.json. Those two strings exist nowhere else; if the file isrenamed or loses its
linkblock, Docusaurus falls back to the directoryname and drops the blurb, in a build that stays green
communitySidebarand the breadcrumb trail still render —a generated index that drops out of the sidebar is reachable only by typing
the URL
titleanddescriptionverbatimand links to the
slugthat doc declares<h1>— whichis written in the leaf body rather than derived from frontmatter, so this
catches an empty shell as well as a 404
sitemap.xml, compared as parsedpathnames so a substring cannot pass for a different route
Expectations are read from
_category_.jsonand the leaf frontmatter ratherthan hardcoded, so a newly added TCG is covered on arrival instead of needing
this file edited. A fixture guard fails loudly if the directory ever stops
yielding docs, which would otherwise turn the per-leaf cases into zero tests.
Disjointness
platform-engineeringleaf page; this PR covers theindex that lists it. Different route, different spec file.
/community/user-groupsgenerated index and its own_category_.json; this is the sibling TCG directory, untouched by it.Verification
Against
main@7772dcf:npm ci,npm run build:production, thennpx playwright test tests/e2e/technical-community-groups.spec.js— 8passed.
npm run test:unit:coverage:checkstill exits 0.Checked non-vacuous by mutating
link.descriptionin_category_.json,rebuilding, restoring the JSON and re-running against the drifted build: the
description assertion failed with
element(s) not found, and went green againafter a clean rebuild.
Note for reviewers running this locally:
playwright.config.jsservesbuild/and sets
reuseExistingServer, so a staledocusaurus servealready bound toport 3000 will be reused and your results will describe its build rather than
yours. Set
E2E_PORTif that is a possibility.Related Issue
Closes #843
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88