Skip to content

[scanner] 🐛 fix: update StorageOverview and MiniDashboard tests for useModalState migration#19310

Merged
clubanderson merged 1 commit into
mainfrom
scanner/fix-19309
Jun 20, 2026
Merged

[scanner] 🐛 fix: update StorageOverview and MiniDashboard tests for useModalState migration#19310
clubanderson merged 1 commit into
mainfrom
scanner/fix-19309

Conversation

@clubanderson

Copy link
Copy Markdown
Collaborator

Fixes #19309

Updates test expectations to match the component API changes from PR #19295 (useModalState hook migration).

…seModalState migration

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 15:41
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jun 20, 2026
@netlify

netlify Bot commented Jun 20, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit f7cfc89
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a36b4ba05b19c0008eb6a2d
😎 Deploy Preview https://deploy-preview-19310.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 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

@github-actions

Copy link
Copy Markdown
Contributor

🐝 Hi @clubanderson! I'm kubestellar-hive[bot], an automation bot for this repo.

Trusted users — org members and contributors with write access — can mention @kubestellar-hive in a comment to trigger repo automation.
On issues, that mention queues an automated fix attempt. On pull requests, it records extra context for existing automation.
This is not an interactive Q&A bot, so mentions should be treated as requests for automation rather than a conversation.

Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @clubanderson — 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 the ai-generated Pull request generated by AI label Jun 20, 2026
@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Test Coverage Check

All new source files in this PR have corresponding test files.

Checked web/src/hooks/ and web/src/components/ against origin/main.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates frontend unit tests that started failing after the useModalState migration (PR #19295), aligning assertions and mocks with the updated component behavior for StorageOverview and MiniDashboard. CI will validate web build/lint on the PR.

Changes:

  • Update MiniDashboard test expectations to assert health/status color-coding based on offline nodes and pod issues.
  • Refactor StorageOverview tests with centralized mock setup and updated i18n/formatting expectations to match current rendering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
web/src/components/widget/MiniDashboard.test.tsx Updates mocks and assertions to validate status indicators and CSS class-based health coloring.
web/src/components/cards/tests/StorageOverview.test.tsx Refactors mocks/setup and updates assertions for skeleton/empty states, stats, cluster filter, and footer text.

Comment on lines 47 to 51
vi.mock('../../../lib/cards/CardComponents', () => ({
CardClusterFilter: () => <div data-testid="cluster-filter" />,
CardClusterFilter: ({ availableClusters }: { availableClusters: Array<{ name: string }> }) => (
<div data-testid="cluster-filter" data-count={availableClusters.length} />
),
}))
@clubanderson clubanderson merged commit 697cf5e into main Jun 20, 2026
46 of 53 checks passed
@kubestellar-prow kubestellar-prow Bot deleted the scanner/fix-19309 branch June 20, 2026 16:04
@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 697cf5e248ef8f6ccfd41c046c95ce44a37cb470.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: 697cf5e248ef8f6ccfd41c046c95ce44a37cb470
Specs run: Dashboard.spec.ts smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/27876489827

clubanderson added a commit that referenced this pull request Jun 20, 2026
…tion (#19312)

The CardComponents mock only exported CardClusterFilter, but after PR #19310
the StorageOverview component uses CardControlsRow, CardHeaderRow, CardStatGrid,
and CardStatHeader from that module. These were undefined in the mock, causing
all 7 tests to fail when the component tried to render them.

- Add React import for ReactNode type usage in mocks
- Add CardHeaderRow mock (renders children as fragment)
- Replace CardClusterFilter mock with CardControlsRow mock that renders
  the cluster-filter testid when clusterFilter prop is provided
- Add CardStatGrid mock (renders children as fragment)
- Add CardStatHeader mock (renders children as fragment)

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

🐛 8 test failure(s) in Coverage Suite run #3829

2 participants