[quality] add unit tests for demoData.ts (Refs #22679) - #22688
[quality] add unit tests for demoData.ts (Refs #22679)#22688kubestellar-hive[bot] wants to merge 1 commit into
Conversation
Adds `__tests__/demoData.test.ts` (54 assertions) targeting the zero-test module `web/src/lib/unified/registerHooks/demoData.ts` (487 LOC), a follow-up to #22679. Asserts: - every DEMO_* export is a defined, non-null array or object - DEMO_HOOK_TABLE is internally consistent: unique names, useXxx PascalCase convention, every referenced dataset is a non-empty array - representative dataset shapes (DEMO_CLUSTER_METRICS, DEMO_TOP_PODS, DEMO_GITOPS_DRIFT status enum, DEMO_ARGOCD_APPLICATIONS, DEMO_STORAGE_OVERVIEW, DEMO_COMPUTE_OVERVIEW, DEMO_GPU_INVENTORY, DEMO_POD_HEALTH_TREND, DEMO_RESOURCE_TREND percent bounds) - every array-typed DEMO_* export is a non-empty array of plain objects (table-driven via it.each) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: kubestellar-hive[bot] <223556219+Copilot@users.noreply.github.com>
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[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 |
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
| // The pattern in the table is: array-typed exports are inlined, | ||
| // object-typed exports are wrapped as `[DEMO_FOO]`. A .length of 1 | ||
| // where the element is a plain object confirms the wrapper form. | ||
| for (const { name, data } of DEMO_HOOK_TABLE) { |
| // The pattern in the table is: array-typed exports are inlined, | ||
| // object-typed exports are wrapped as `[DEMO_FOO]`. A .length of 1 | ||
| // where the element is a plain object confirms the wrapper form. | ||
| for (const { name, data } of DEMO_HOOK_TABLE) { |
❌ Playwright Tests Failed📊 View Full ReportDownload the To view the report locally: # Download and extract playwright-report.zip
npx playwright show-report path/to/playwright-report |
🛑 Fix loop escalated — human attention neededThis PR has failed CI on 1 distinct fix attempts (new commits, still red). The hive has stopped dispatching further automated fixes for it. Failing checks: Test (chromium, shard 2), Test (chromium, shard 3), build-gate Raw failure evidence (from check-run annotations): Remove the |
Test Improvement
Adds
__tests__/demoData.test.ts(54 assertions) targeting the previously zero-test moduleweb/src/lib/unified/registerHooks/demoData.ts(487 LOC) — a follow-up to #22679. Same lightweight structural-invariant pattern used for #22686 (acmm.criteria.ts).What the tests cover
DEMO_*export is defined, non-null, and object-typed.{ name: string, data: unknown[] }.use[A-Z][A-Za-z0-9]*React-hook convention.DEMO_CLUSTER_METRICS— numerictimestamp/cpu/memory/pods.DEMO_TOP_PODS— stringname/namespace/cluster, numericcpu/memory.DEMO_GITOPS_DRIFT— status enum{synced, drifted}, numericlastSync.DEMO_ARGOCD_APPLICATIONS— Argo-shaped strings.DEMO_STORAGE_OVERVIEW— numeric fields;used <= totalCapacity.DEMO_COMPUTE_OVERVIEW— numeric fields.DEMO_GPU_INVENTORY— utilization in[0, 100].DEMO_RESOURCE_TREND— cpu/memory percentages in[0, 100].DEMO_POD_HEALTH_TREND— non-negative counts.it.each): every array-typedDEMO_*export is a non-empty array of plain objects — 40+ generated cases with per-export failure messages.Result
Refs #22679 — this is the second in the follow-up series after #22686.
lib/cache/cacheCore.tsand thehooks/mcp/*family remain open for later PRs (recorded as advisory beads).Filed by quality agent (ACMM L3/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-opus-4.7