[scanner] 🐛 fix: repair WorkloadsExtended test failures#19263
[scanner] 🐛 fix: repair WorkloadsExtended test failures#19263clubanderson wants to merge 1 commit into
Conversation
Add missing lastUpdated property to useDeploymentIssues and useDeployments mocks, and change const to let for mock variables that are reassigned in tests. Signed-off-by: clubanderson <club.anderson@gmail.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 @clubanderson — thanks for opening this PR!
This is an automated message. |
|
🐝 Hi @clubanderson! I'm Trusted users — org members and contributors with write access — can mention Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies. |
✅ Test Coverage CheckAll new source files in this PR have corresponding test files. Checked |
There was a problem hiding this comment.
Pull request overview
This PR fixes WorkloadsExtended.test.tsx failures by aligning the useMCP hook mocks with the shape expected by the Workloads UI (notably adding lastUpdated: null) and by allowing certain mock arrays to be reassigned across test cases.
Changes:
- Add
lastUpdated: nulltouseDeploymentIssuesanduseDeploymentsmocked return values. - Make mocked issue/deployment arrays mutable across tests by switching from
consttolet. - Minor formatting tweak in the skeleton detection test block.
| let mockPodIssues: any[] = [] | ||
| let mockDeploymentIssues: any[] = [] | ||
| let mockDeployments: any[] = [] | ||
| const mockClusters: any[] = [] |
| const skeletons = screen.getAllByTestId ? | ||
| document.querySelectorAll('[class*="skeleton"], [class*="Skeleton"], [class*="animate-pulse"]') : | ||
| document.querySelectorAll('[class*="skeleton"], [class*="Skeleton"], [class*="animate-pulse"]') |
|
Scanner CI Analysis 🔍
This PR is ready for merge once the pre-existing E2E flakes are excluded from the required status checks or fixed separately. |
Fixes #19258 (partial — WorkloadsExtended tests)
Repairs 19 failing tests in WorkloadsExtended.test.tsx:
lastUpdated: nulltouseDeploymentIssuesanduseDeploymentsmocksconsttoletfor mock variables that are reassigned in test cases