Skip to content

[quality] docs/ and blog/ MDX component imports and CNCFProjectCard props have no unit coverage #297

Closed

Description

@hivecommons-hive

Finding

Nothing in tests/ reads a docs/ or blog/ file's MDX component imports or
JSX props. grep -rln '@site' tests/ and grep -rln 'blog/' tests/ both return
nothing at rev 00b44df.

Two distinct gaps sit behind that:

1. Component imports are verified only by a full site build.
docs/ carries 8 @site/src/components/... imports and 9 distinct capitalized
JSX tags. .github/workflows/ci.yml runs npm run build:production on every
PR, so an un-imported tag or a moved component directory is caught — but late,
as a Docusaurus/webpack error wall rather than a named assertion, and only after
npm ci plus a full production build. Any refactor that moves a component
directory (for example splitting MemberDirectory) breaks a docs import with no
fast signal.

2. Misspelled <CNCFProjectCard> props are caught by nothing at all.
docs/architectures/*.md contains 50 hand-authored <CNCFProjectCard />
usages
. src/components/CNCFProjectCard/index.js destructures a fixed prop
set (name, logo, href, since, version, description). MDX passes
unknown props straight through, so descripton="..." or url="..." is dropped
silently: the card renders without the text or the link, the production build
stays green, and no validator reports it. This is covered by neither unit nor
end-to-end tests.

name is also dereferenced unconditionally (name.slice(0, 1) in the fallback
logo branch) and href is the card's only navigation target, so neither has a
usable default.

Recommendation

Add tests/mdx-components.test.mjs — a test-only file using nothing but
node:test, node:assert/strict, node:fs and node:path — asserting over
every docs/**/*.md{,x} and blog/**/*.md{,x}:

  • every capitalized JSX tag used in a file is imported in that same file
  • every @site/ import specifier resolves to a file on disk
  • every <CNCFProjectCard /> supplies name and href
  • no <CNCFProjectCard /> passes a prop the component does not destructure,
    with the accepted set parsed out of the component so a rename there cannot
    silently diverge from the 50 usages
  • the scan is non-empty, so the assertions cannot pass vacuously

Fenced and inline code must be stripped before scanning, or the literal
`src/components/<Name>/index.js` in docs/skills/ui-standards.md reads as
a component usage.

Evidence

  • Unit: node --test --experimental-test-coverage (node v26.8.1) locally at
    rev 00b44df — 55 tests pass; the coverage table lists only scripts/ and
    tests/helpers.mjs. No test touches docs/, blog/, or src/components/
    prop contracts.
  • End-to-end: .github/workflows/ci.yml → npm run build:production on
    every pull_request; deploy-gh-pages.yml runs the same on main. Covers
    import resolution, does not cover unknown props.

Scope

This issue claims exactly one new file, tests/mdx-components.test.mjs, and one
cluster: MDX component import and prop wiring in docs/ and blog/. It
deliberately does not assert markdown-link or frontmatter integrity (#296),
navbar/sidebar wiring (#275), /img static asset resolution (#289), the
data/architectures catalog-to-docs contract (#260), blog/ frontmatter
(#270), or package.json/workflow command wiring (#278).

Priority

  • Impact: medium
  • Effort: low

Filed by quality agent (hold-gated mode)

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

Activity

  1. added
    qualityApproved by a Hive merger/owner for auto-merge on green CI
    testingApproved by a Hive merger/owner for auto-merge on green CI
    agent/qualityApproved by a Hive merger/owner for auto-merge on green CI
    on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityApproved by a Hive merger/owner for auto-merge on green CIhive/hosted-available-lke648397-260827-5n31Approved by a Hive merger/owner for auto-merge on green CIqualityApproved by a Hive merger/owner for auto-merge on green CItestingApproved by a Hive merger/owner for auto-merge on green CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions