Skip to content

[quality] replace stub with behavioral tests for stats/configs.ts (Refs #22679) - #22701

Merged
kubestellar-hive[bot] merged 1 commit into
mainfrom
quality/test-stats-configs
Aug 21, 2026
Merged

[quality] replace stub with behavioral tests for stats/configs.ts (Refs #22679)#22701
kubestellar-hive[bot] merged 1 commit into
mainfrom
quality/test-stats-configs

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

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

describe('unified/stats/configs', () => {
  it('module can be imported', async () => {
    const mod = await import('../configs')
    expect(mod).toBeDefined()
  })
})

After

  • Named exports: every *_STATS_CONFIG and getUnifiedStatsConfig is exported.
  • Per-config shape — table-driven across all 17 configs (clusters, workloads, pods, gitops, storage, network, security, compliance, data-compliance, compute, events, cost, alerts, dashboard, operators, deploy, multi-tenancy):
    • type/title/blocks/collapsible/showConfigButton/storageKey conform to the UnifiedStatsSectionConfig interface.
    • storageKey is derived as kubestellar-<type>-stats-collapsed (locks in the localStorage key convention).
    • blocks[] is non-empty with well-formed UnifiedStatBlockConfig entries.
    • block.order is a contiguous 0..n-1 range — asserts convertBlock's index assignment matches the array order (regression fence for any future refactor that reorders blocks).
    • block.id values are unique within a config.
    • valueSource always routes through the getStatValue hook callback and the field matches block.id.
  • Lookup fn: getUnifiedStatsConfig() returns the correct config for every StatsConfigType and matches the corresponding named export by reference.
  • Cross-config invariants: all storageKeys and type identifiers are unique (guards against copy-paste config collisions).

Result

✓ src/lib/unified/stats/__tests__/configs.test.ts (107 tests) 380ms
Test Files  1 passed (1)
     Tests  107 passed (107)

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

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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Aug 21, 2026
@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit d4a51ef
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a881a81470359000813d248
😎 Deploy Preview https://deploy-preview-22701.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[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 eeshaansa 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

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@github-actions github-actions Bot added ai-generated Pull request generated by AI tier/1-lightweight labels Aug 21, 2026
@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ Playwright Tests Failed

📊 View Full Report

Download the playwright-report artifact from the workflow run for screenshots and detailed traces.

To view the report locally:

# Download and extract playwright-report.zip
npx playwright show-report path/to/playwright-report

@kubestellar-hive
kubestellar-hive Bot merged commit ebf6d80 into main Aug 21, 2026
44 of 49 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-stats-configs branch August 21, 2026 09:58
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit ebf6d806d41dbc0f058f1f1d2c4e47601625a258.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: ebf6d806d41dbc0f058f1f1d2c4e47601625a258
Specs run: smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/32470440506

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

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tier/1-lightweight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant