[quality] add shape-invariants tests for handbookCards (0 → 11) - #6819
[quality] add shape-invariants tests for handbookCards (0 → 11)#6819kubestellar-hive[bot] wants to merge 1 commit into
Conversation
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>
|
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 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
❌ Deploy Preview for kubestellar-docs failed. Why did it fail? →
|
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
PR needs rebase. DetailsInstructions 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. |
Test Improvement
src/app/[locale]/contribute-handbook/handbook.tsexports thehandbookCardsdata source rendered by the Community Handbook page atsrc/app/[locale]/contribute-handbook/page.tsx. Nothing insrc/__tests__/imported the module before this change — a typo like"/docs/contribute/…"instead of"/docs/contributing/…"would silently dead-end every handbook card, becausesrc/app/docs/page-map.ts::buildNavNodesroutes 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 existingversions.shape-invariants.test.tspattern already used for the peer data module insrc/config/.Invariants asserted
id,iconType,iconPath,bgColor,iconColor,link).ids are unique (React key stability).linkstarts with/docs/contributing/(routing contract withpage-map.ts).bgColormatches the design-systembg-<color>-<n>/<opacity>shape — guards against a solidbg-*-500regression that would visually dominate the card.iconColormatchestext-<color>-<n>.iconTypeis kebab-case (matches the shared icon lookup keys).iconPathcontains 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