Skip to content

test: cover the /community/user-groups generated index end to end - #840

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

mrbobbytables merged 1 commit into
mainfrom
quality/test-user-groups-index

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

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

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

Because nothing on disk holds the result, no unit test can assert it — and no
e2e spec loaded it. legacy-urls.spec.js reaches the two leaf pages by clicking
through their redirect stubs, but asserts only not-404 plus the presence of an
article element, never page content, and never the index. docs/community/index.md
links here as the way a visitor finds a peer group, so 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 spec asserts that:

  • /community/user-groups serves and renders the _category_.json title and description
  • the index shows exactly one card per doc in docs/community/user-groups/
  • each card carries its doc's frontmatter title and description verbatim
  • each card links to the slug that doc declares, and clicking it lands there
  • each leaf route serves its own h1 and is a listed page (unlike the stubs that forward to it)
  • the index and both leaves appear in sitemap.xml

Expectations are read from _category_.json and the leaf frontmatter rather than
restated, so adding a third user group extends the contract instead of breaking it.
A guard test fails first if that directory is emptied or the frontmatter stops
parsing, so nothing below it can pass vacuously.

Verification

At 7772dcf, against build/ from npm run build:production:

  • npx playwright test tests/e2e/user-groups.spec.js — 11 passed
  • npx playwright test (whole suite) — 124 passed
  • npm run test:unit — 1423 tests, 1421 pass, 0 fail
  • npx prettier --check tests/e2e/user-groups.spec.js — clean

Mutation-validated against real source-to-build drift (mutating the built HTML
alone proves nothing here — the page rehydrates and React re-renders it from the
JS bundles):

  • rebuilt with telecom.md's description changed, then restored the source:
    only the Telecom card carries its doc's description and link failed
  • rebuilt with telecom.md removed, then restored the source: the card-count,
    sitemap, Telecom card, Telecom click-through and Telecom leaf-page tests
    failed — 5 failed, 6 passed

Disjointness

Nothing here overlaps the open hold-gated PRs. #829 covers /resources,
/community/governance and the platform-engineering TCG leaf; its diff
never mentions user-groups. #834 covers /resources/radar-reports, #838 the
landing page, #832 docs/events/index.md as a unit contract. The remaining
open PRs (#810, #818, #820, #825, #812, #827, #836) touch scripts/ modules and
their unit tests. This PR adds one new e2e spec and changes no existing file.

Related Issue

Closes #839


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

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

The User Groups section is served by a generated-index route: its
_category_.json declares link.type=generated-index, so /community/user-groups
has no source document. Docusaurus synthesises the heading and blurb from that
JSON and one card per doc in the directory from each doc's frontmatter title
and description.

Nothing on disk holds the result, so no unit test can assert it, and no e2e
spec loaded it: legacy-urls.spec.js reaches the two leaf pages by clicking
through their redirect stubs but asserts only not-404 plus the presence of an
article element. Moving a doc out of the directory, renaming a slug or dropping
a frontmatter description would empty or mislabel a page that docs/community
links to as the way a visitor finds a peer group, while every test stayed
green.

tests/e2e/user-groups.spec.js derives its expectations from _category_.json and
the leaf frontmatter rather than restating them, so adding a third user group
extends the contract instead of breaking it, and asserts the index serves,
renders the category title and description, shows exactly one card per doc
carrying that doc's title and description, links each card to the slug the doc
declares, serves each leaf as a listed page with its own heading, and lists all
three routes in sitemap.xml.

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.

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/user-groups generated-index route and its two leaf pages have no end-to-end coverage

1 participant