🐛 Fix 25 ClusterHealth/ClusterDetailModal test failures#13754
Conversation
…oleUrl dedup After PR #13747 moved getConsoleUrl into CloudProviderIcon and updated both ClusterHealth.tsx and ClusterDetailModal.tsx to import it from there, the vi.mock() stubs for CloudProviderIcon in the two test files were missing the getConsoleUrl export. This caused the mocked module to return undefined for getConsoleUrl, crashing the components under test. Fix: add getConsoleUrl: () => null to both mocks so the import resolves correctly during tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: kubestellar-hive <hive-bot@kubestellar.io>
|
[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 kubestellarconsole failed. Why did it fail? →
|
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
✅ Test Coverage CheckAll new source files in this PR have corresponding test files. Checked |
|
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: |
Fixes #13749
25 tests in ClusterHealth and ClusterDetailModal were failing after PR #13747 deduplicated getConsoleUrl. This PR fixes the test failures.
Root Cause
PR #13747 moved
getConsoleUrlintoCloudProviderIcon.tsxand updated bothClusterHealth.tsxandClusterDetailModal.tsxto import it from there. However, thevi.mock('../../ui/CloudProviderIcon', ...)stubs in both test files were not updated to includegetConsoleUrlin the mock object. The mocked module returnedundefinedforgetConsoleUrl, causing the components to crash during tests.Fix
Added
getConsoleUrl: () => nullto theCloudProviderIconmock in:src/components/cards/__tests__/ClusterHealth.test.tsxsrc/components/clusters/__tests__/ClusterDetailModal.test.tsx