Repository navigation
[quality] docs/ and blog/ MDX component imports and CNCFProjectCard props have no unit coverage #297
Description
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 />suppliesnameandhref - 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
rev00b44df— 55 tests pass; the coverage table lists onlyscripts/and
tests/helpers.mjs. No test touchesdocs/,blog/, orsrc/components/
prop contracts. - End-to-end:
.github/workflows/ci.yml→npm run build:productionon
everypull_request;deploy-gh-pages.ymlruns the same onmain. 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