[quality] replace stub with behavioral tests for stats/configs.ts (Refs #22679) - #22701
Conversation
Upgrades the placeholder "module can be imported" test for `web/src/lib/unified/stats/configs.ts` (220 LOC) into 107 behavioral assertions. Follow-up to #22679 targeting stub tests that give import-time coverage but do not verify contracts. New assertions cover: - Every expected STATS_CONFIG constant is exported. - Per-config shape (table-driven across all 17 configs): * UnifiedStatsSectionConfig fields: type/title/blocks/collapsible/ showConfigButton/storageKey * storageKey is derived as `kubestellar-<type>-stats-collapsed` * blocks are non-empty and well-formed UnifiedStatBlockConfig items * block order is a contiguous 0..n-1 range (asserts convertBlock's order-index assignment) * block ids are unique within a config * valueSource routes through the getStatValue hook callback and the field matches the block id - getUnifiedStatsConfig() returns the correct config for every StatsConfigType and matches the corresponding named export. - Cross-config: all storageKeys and type identifiers are unique. Result: 107 tests passing locally. 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. |
❌ 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 |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
✅ Post-Merge Verification: passedCommit: |
Test Improvement
Upgrades the placeholder "module can be imported" test for
web/src/lib/unified/stats/configs.ts(220 LOC) into 107 behavioral assertions. Follow-up to #22679 targeting a class of stub tests that give import-time coverage but do not verify contracts.Before
After
*_STATS_CONFIGandgetUnifiedStatsConfigis exported.type/title/blocks/collapsible/showConfigButton/storageKeyconform to theUnifiedStatsSectionConfiginterface.storageKeyis derived askubestellar-<type>-stats-collapsed(locks in the localStorage key convention).blocks[]is non-empty with well-formedUnifiedStatBlockConfigentries.block.orderis a contiguous0..n-1range — assertsconvertBlock's index assignment matches the array order (regression fence for any future refactor that reorders blocks).block.idvalues are unique within a config.valueSourcealways routes through thegetStatValuehook callback and thefieldmatchesblock.id.getUnifiedStatsConfig()returns the correct config for everyStatsConfigTypeand matches the corresponding named export by reference.storageKeys andtypeidentifiers are unique (guards against copy-paste config collisions).Result
Refs #22679 — extends the coverage-gap follow-up series (#22686 acmm.criteria merged, #22688 registerHooks/demoData open, #22691 insights/demoData + hookTables merged) by targeting stub tests rather than untested files. About 20 more stub tests of this shape exist in the tree (see beads); tackling them individually as effort permits.
Filed by quality agent (ACMM L3/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-opus-4.7