Skip to content

test: cover ProjectsBorn full and compact rendered output - #479

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-projects-born-compact
Sep 23, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-projects-born-compact

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds tests/projects-born-render.test.mjs. No production file changes.

src/components/ProjectsBorn/index.js renders two different things from one
component: the full section embedded by docs/community/index.md and
docs/practitioners/index.md, and the compact strip that
src/theme/Footer/index.js:141 renders as <ProjectsBorn compact /> — on
every page of the site.

Before this PR, per-file isolation across every tests/*.test.mjs
(node --test --experimental-test-coverage --test-coverage-include='src/components/ProjectsBorn/**')
showed only two files touching the component:

test file line % funcs % what it asserts
tests/jsx-hooks.test.mjs 96.08 100.00 that the @site alias resolves; renders it as a fixture and asserts only tree.type === 'section'
tests/footer.test.mjs 13.73 0.00 that the footer passes compact={true}; never renders the returned element

So the compact form was never rendered, and nothing asserted the markup of
either form.

The new file renders both forms through the existing tests/helpers-jsx.mjs /
tests/tools/react-element-tree.mjs harness — the pattern
tests/cncf-project-card.test.mjs and tests/radar-reports.test.mjs already
use — with 13 tests covering:

  • one keyed anchor per data/projects-born.json entry, in corpus order, in both forms
  • the full form's default title, intro, per-project descriptions and TAB footer note
  • the compact form dropping exactly those three prose blocks while still linking every project by name and origin
  • the two forms' distinct heading ids, and aria-labelledby resolving to an h2 inside its own tree (a shared id would be ambiguous on a docs page that renders both)
  • the title/intro prop overrides docs/practitioners/index.md:72 depends on, and intro being ignored when compact
  • the decorative ↗ staying aria-hidden
  • no project tile opening a new tab without rel="noreferrer"

Result

src/components/ProjectsBorn/index.js | 100.00 | 100.00 | 100.00 |

up from 96.08 / 60.00 / 100.00 with lines 13-14 uncovered.

The assertions were mutation-checked, not just run: removing the !compact
guard on the intro paragraph fails the compact strip drops the intro, descriptions and TAB footer note and the intro prop is ignored in the compact strip. The file is prettier --check clean.

Files claimed

  • tests/projects-born-render.test.mjs (new, the only file in this PR)

Disjoint from every open PR: #435 (ArchitectureFilters), #476
(pr-queue-hygiene), #225 (package.json + tests/tools/coverage-report.mjs),
#195/#212/#266/#291 (import/validator/packaging). None touches
src/components/ProjectsBorn/**, tests/projects-born-*,
tests/footer.test.mjs or tests/jsx-hooks.test.mjs.

Related Issue

Closes #478 — every box in that issue's task list is implemented here, and
merging leaves nothing further for it to track.


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

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

src/components/ProjectsBorn/index.js renders the full section embedded by
docs/community and docs/practitioners, and the compact strip that
src/theme/Footer ships on every page. Only the full form was ever executed,
incidentally, as a module-resolution fixture in tests/jsx-hooks.test.mjs; the
compact form was never rendered at all, leaving its four compact-gated
branches and the title/intro prop overrides unguarded.

tests/projects-born-render.test.mjs renders both forms through the existing
helpers-jsx / react-element-tree harness and asserts the per-project anchor
mapping, the prose blocks the compact form drops, the distinct heading ids
behind aria-labelledby, the prop overrides, the aria-hidden arrow and the
noreferrer pairing. This takes the component to 100% lines, branches and
functions.

Signed-off-by: kubestellar-hive[bot] <kubestellar-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.

@hivecommons-hive hivecommons-hive Bot added quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-lke648397-260827-5n31 labels Sep 22, 2026
@mrbobbytables
mrbobbytables added this pull request to the merge queue Sep 23, 2026
Merged via the queue into main with commit 763f969 Sep 23, 2026
2 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-projects-born-compact branch September 25, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Approved by a Hive merger/owner for auto-merge on green CI hold quality Approved by a Hive merger/owner for auto-merge on green CI testing Approved by a Hive merger/owner for auto-merge on green CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] ProjectsBorn compact form, shipped in the site footer on every page, has zero rendered coverage

1 participant