Skip to content

[quality] test: cover data/members.json contract and awards.json slug parity (tests/members-data.test.mjs) - #253

Open
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-members-data
Open

kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-members-data

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds tests/members-data.test.mjs — a contract test for data/members.json, the sole input to src/components/MemberDirectory/index.js.

Nothing validated this file before: there is no validate:members script in package.json, and no test referenced it. MemberDirectory dereferences member.industries.forEach, member.projects.forEach, member.architectures.length, member.awards.length and member.sourceAttribution.map with no guards, so a regeneration that drops one of those arrays crashes the Docusaurus production build.

14 assertions, data-only, no new test infrastructure:

  • generated envelope: description, schema, and generatedFrom still naming data/architectures/catalog.json + data/awards.json
  • every member exposes each documented schema key
  • every member carries the five arrays MemberDirectory renders unguarded
  • id/slug unique, kebab-case, and equal so profile links resolve
  • members stay sorted by display name, matching generate-members.mjs output
  • every logo is an /img/ path whose file exists under static/ — the check validate-awards.mjs already does for awards.json, previously absent here
  • nested architecture entries carry id, title, https sourceUrl, 40-hex sourceCommit
  • nested award entries carry year, award, awardLabel, citation, event, https URLs where present
  • sourceAttribution entries are https URLs
  • cross-file parity in both directions with data/awards.json, keyed on slug rather than display name (awards.json says Mercedes-Benz Tech Innovation, the member displays Mercedes-Benz, both slug to mercedes-benz-tech-innovation)

Verification

  • node --test tests/members-data.test.mjs — 14/14 pass
  • node --test — 69/69 pass (55 existing + 14 new)
  • npx prettier --check tests/members-data.test.mjs — clean
  • Mutation-checked: deleting an entry's industries, pointing a logo at a missing file, and corrupting a slug to Bad_Slug fails 5 of the 14 tests; data/members.json restored unmodified (only the new test file is in this diff)

Scope

Claims exactly one file: tests/members-data.test.mjs. Disjoint from the open quality PRs — #208 tests scripts/generate-members.mjs generator logic against fixtures in a sandbox, not the committed artifact; #235/#239/#241 are the same contract-test pattern applied to data/milestones.json, data/projects-born.json and data/community-roster.json. This is the remaining unvalidated data file. Touches no src/ module, so it is independent of #118 (MemberDirectory refactor) and #229 (JSX import harness).

Related Issue

Refs #252


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

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

data/members.json drives src/components/MemberDirectory/index.js, which
dereferences member.industries, member.projects, member.architectures,
member.awards and member.sourceAttribution without guards, but nothing
validated the file: there is no validate:members script and no test
referenced it.

Add tests/members-data.test.mjs covering the generated envelope, the
required entry arrays, unique kebab-case id/slug, name ordering, logo
files resolving under static/, nested architecture and award entry
shape, https source attribution, and slug-keyed parity in both
directions with data/awards.json.

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

@kubestellar-hive kubestellar-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 Approved by a Hive merger/owner for auto-merge on green CI labels Sep 17, 2026
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 hive/hosted-available-lke648397-260827-5n31 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.

0 participants