Skip to content

[quality] add shape-invariants tests for handbookCards (0 → 11) - #6819

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

[quality] add shape-invariants tests for handbookCards (0 → 11)#6819
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-handbook-invariants

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

src/app/[locale]/contribute-handbook/handbook.ts exports the handbookCards data source rendered by the Community Handbook page at src/app/[locale]/contribute-handbook/page.tsx. Nothing in src/__tests__/ imported the module before this change — a typo like "/docs/contribute/…" instead of "/docs/contributing/…" would silently dead-end every handbook card, because src/app/docs/page-map.ts::buildNavNodes routes shared-section pages under /docs/contributing/ only. No compile error, no runtime error.

Test file

src/__tests__/handbook.shape-invariants.test.ts — 11 pure-data invariants. This follows the existing versions.shape-invariants.test.ts pattern already used for the peer data module in src/config/.

Invariants asserted

  • Non-empty array; every card has every required non-empty string field (id, iconType, iconPath, bgColor, iconColor, link).
  • Card ids are unique (React key stability).
  • Every link starts with /docs/contributing/ (routing contract with page-map.ts).
  • Links are unique and contain no whitespace.
  • bgColor matches the design-system bg-<color>-<n>/<opacity> shape — guards against a solid bg-*-500 regression that would visually dominate the card.
  • iconColor matches text-<color>-<n>.
  • iconType is kebab-case (matches the shared icon lookup keys).
  • iconPath contains only SVG path-data characters and begins with a valid move-to command (M/m). Anything else would break the raw SVG the page inlines.

Result

11 tests pass in ~60ms.

Refs #6703


Filed by quality agent (ACMM L4/L6 — full mode)

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

src/app/[locale]/contribute-handbook/handbook.ts exports the
`handbookCards` data source rendered by the Community Handbook page
at src/app/[locale]/contribute-handbook/page.tsx. Nothing in
src/__tests__/ imported the module before this change — a typo like
"/docs/contribute/…" instead of "/docs/contributing/…" would silently
dead-end every handbook card because src/app/docs/page-map.ts::
buildNavNodes routes shared-section pages under /docs/contributing/
only.

Add src/__tests__/handbook.shape-invariants.test.ts with 11 pure-data
invariants. These follow the existing versions.shape-invariants
pattern already used for the peer data module in src/config/.

Invariants asserted:

- Non-empty array, every card has every required non-empty string
  field (id, iconType, iconPath, bgColor, iconColor, link).
- Card ids are unique (React key stability).
- Every link starts with `/docs/contributing/` (routing contract with
  page-map.ts).
- Links are unique and contain no whitespace.
- bgColor matches the design-system `bg-<color>-<n>/<opacity>` shape
  (guards against a solid `bg-*-500` regression that would visually
  dominate the card).
- iconColor matches the `text-<color>-<n>` shape.
- iconType is kebab-case (matches the shared icon lookup keys).
- iconPath contains only SVG path-data characters and begins with a
  valid move-to command (M or m). Anything else would break the raw
  SVG the page inlines.

11 tests pass in ~60ms.

Refs #6703

Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: kubestellar-hive[bot] <223556219+Copilot@users.noreply.github.com>
@kubestellar-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human sign-off on the direction, not on the code.

This PR's only tracked rationale is #6703, which the hive filed itself — issue #6703 was filed by kubestellar-hive[bot] and no human has acknowledged it. An agent-filed issue does not, on its own, establish that anyone agreed to the direction (hivecommons/hive#5117).

The change may well be right; nothing here is a review of it. To release the hold, acknowledge the direction on that issue — comment on it, assign yourself, or add the approved-direction label — and remove the hold label here.

@kubestellar-hive kubestellar-hive Bot added the hold label Sep 8, 2026
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 8, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Sep 8, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellar-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 38fe6eb
🔍 Latest deploy log https://app.netlify.com/projects/kubestellar-docs/deploys/6aa09818f74b510008acb693

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 8, 2026
@kubestellar-prow kubestellar-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 8, 2026
@kubestellar-prow

Copy link
Copy Markdown

Hi @kubestellar-hive[bot]. Thanks for your PR.

I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubestellar-prow kubestellar-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 9, 2026
@kubestellar-prow

Copy link
Copy Markdown

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. frontend hold needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant