Skip to content

test: cover the /community/technical-community-groups generated index end to end - #844

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-tcg-generated-index
Sep 29, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-tcg-generated-index

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds tests/e2e/technical-community-groups.spec.js — the only file this PR
touches.

/community/technical-community-groups is a generated-index route:
docs/community/technical-community-groups/_category_.json declares
link.type: "generated-index", so the page has no source document. Docusaurus
synthesises the <h1> and the blurb from that JSON, and one card per doc in
the directory from each doc's frontmatter title, description and slug.

Because nothing on disk holds the rendered result, no unit test can assert it —
and no e2e spec loaded it. At main @ 7772dcf the string
technical-community-groups did not appear anywhere under tests/.
npm run test:unit:coverage cannot see the gap either: it reports
src files | 99.84 | 98.46 | 6329/6339 lines while this route is entirely
unexercised, because a generated index contributes no executable source lines
of its own.

The route is not incidental — docs/community/index.md:30 and :87 and
docs/community/technical-advisory-board.md:15 all link to it as the way a
visitor finds a topic group. Moving a doc out of the directory, renaming a
slug, or dropping a frontmatter description would empty or mislabel the
page while every existing test stayed green.

The 8 tests assert that:

  • the route serves — status < 400 and not the "Page Not Found" page, since
    docusaurus serve answers an unknown path with the 404 page
  • the <h1> and the header blurb are the link.title / link.description
    from _category_.json. Those two strings exist nowhere else; if the file is
    renamed or loses its link block, Docusaurus falls back to the directory
    name and drops the blurb, in a build that stays green
  • the autogenerated communitySidebar and the breadcrumb trail still render —
    a generated index that drops out of the sidebar is reachable only by typing
    the URL
  • there is exactly one card per doc in the directory
  • each card carries its doc's frontmatter title and description verbatim
    and links to the slug that doc declares
  • clicking a card lands on that slug and renders the leaf's own <h1> — which
    is written in the leaf body rather than derived from frontmatter, so this
    catches an empty shell as well as a 404
  • the index and its leaves are listed in sitemap.xml, compared as parsed
    pathnames so a substring cannot pass for a different route

Expectations are read from _category_.json and the leaf frontmatter rather
than 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

Verification

Against main @ 7772dcf: npm ci, npm run build:production, then
npx playwright test tests/e2e/technical-community-groups.spec.js — 8
passed
. npm run test:unit:coverage:check still exits 0.

Checked non-vacuous by mutating link.description in _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 again
after a clean rebuild.

Note for reviewers running this locally: playwright.config.js serves build/
and sets reuseExistingServer, so a stale docusaurus serve already bound to
port 3000 will be reused and your results will describe its build rather than
yours. Set E2E_PORT if 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

… 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>
@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.

@mrbobbytables
mrbobbytables added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit b7ae338 Sep 29, 2026
6 checks passed
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.

[quality] /community/technical-community-groups generated index has no unit or e2e coverage

1 participant