Skip to content

test: contract docs/events/index.md against its own freshness promise - #832

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-events-page
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-events-page

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds tests/events-page.test.mjs, a source-side contract for
docs/events/index.md — the /events route the primary navbar links to, which
had no test of any kind before this PR.

The page states its own maintenance contract in prose:

This section is reviewed quarterly (or sooner once End User Summit/Reception
details are published) so it never shows a past event as upcoming. Last
verified: 2026-08-08.

Nothing enforced it. A markdown doc has no executable lines, so
npm run test:unit:coverage could not see the gap either — source coverage
reads 99.84% lines / 98.46% regions on main @ 7772dcf with this page
entirely untested.

Seven assertions, all of them things the page already claims about itself:

assertion why it was unguarded
frontmatter title/description present, doc not unlisted the navbar links to /events; an unlisted doc is dropped from the sidebar and search index
## Upcoming exists, ## Past exists, in that order the staleness check below is meaningless without them
the Upcoming section names at least one dated event keeps the staleness check from passing vacuously if the dateline format is ever reformatted
no event listed as upcoming has already ended the promise the page makes in prose
Last verified: parses and is not in the future mirrors tests/awards-data.test.mjs, which guards the equivalent verifiedAt with verified.getTime() <= Date.now()
every require("@site/...") asset exists on disk a renamed asset is a Docusaurus build failure, surfaced only by a full build
every internal <Link to> / ](/...) target resolves to a doc route tests/jsx-link-hygiene.test.mjs scans only src/, so MDX link targets resolved against nothing

On the wall-clock assertion

no event listed as upcoming has already happened is deliberately time
sensitive, in the one direction the page commits to. KubeCon + CloudNativeCon
North America 2026 is currently listed as upcoming (November 9–12, 2026). When
that date passes, this test going red is the quarterly review reminder the
prose describes, and the fix is a one-line content edit — move the entry under
## Past and refresh Last verified. The route resolution helper is restated
from tests/site-config.test.mjs rather than imported, following that file's
own stated convention, so an unintended change fails in both places.

Verification

  • TZ=UTC node --test tests/events-page.test.mjs — 7 pass, 0 fail
  • Mutation-checked: backdating the upcoming event to 2020, renaming the
    required image and pointing the figure caption at a non-existent route each
    fail the corresponding assertion (3 fail, 4 pass)
  • npm run test:unit — 1430 tests, 0 fail
  • npm run test:unit:coverage:check (--check 97 --check-source 99 --check-regions 93 --check-source-regions 97) — exit 0
  • npx prettier --check tests/events-page.test.mjs — clean

Claimed ground

This PR touches exactly one new file, tests/events-page.test.mjs, and changes
no existing file. It is disjoint from every open hold-gated PR: #810/#812
(import-architecture-issue.mjs), #818 (svg-active-content.mjs), #820
(architecture-catalog-contract.test.mjs), #825/#827
(collect-case-studies.mjs, import-architectures.mjs,
validate-architecture-assets.mjs) and #829 (tests/e2e/docs-routes.spec.js,
which claims /resources, /community/governance and the platform-engineering
TCG route — not /events).

Related Issue

Closes #831


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

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

docs/events/index.md is the /events route the primary navbar links to and
had no test of any kind. The page states its own maintenance contract in
prose -- it "never shows a past event as upcoming", and records a
"Last verified" date -- but nothing enforced it, and a markdown doc has no
executable lines so the coverage report could not see the gap either.

tests/events-page.test.mjs asserts that promise plus the build-time
dependencies the page carries: the frontmatter the navbar relies on, the
Upcoming/Past ordering, that no event listed as upcoming has already ended,
that the "Last verified" date parses and is not in the future, that every
require('@site/...') asset exists on disk, and that every internal link
target resolves to a doc route.

Closes #831

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] docs/events/index.md has no test coverage: its stated 'never shows a past event as upcoming' contract is unenforced

0 participants