[scanner] π fix: repair 20 test failures β remove empty stubs and fix stale selectors#19270
Conversation
- Change refresh button selector from /refreshClusterData/ to /common.refresh/ - Use getAllByText for multiple '-' elements during loading state Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change namespace button selector from /drilldown.fields.namespace/ to /View namespace ns1/ - Change cluster button selector from /drilldown.fields.cluster/ to /View cluster c1/ Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Copilot <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 |
|
π 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. |
|
π Hey @clubanderson β thanks for opening this PR!
This is an automated message. |
β 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 addresses Coverage Suite run #3819 failures by removing empty Vitest βstubβ files that report βNo test suite foundβ, and by updating a couple of UI tests whose selectors drifted from current component accessibility labels.
Changes:
- Delete 16 empty test stub files that were being picked up by Vitest as failing suites.
- Update
ClusterCardList.test.tsxto use current refresh button accessible names and avoid ambiguous'-'text querying. - Update
PodDrillDown.test.tsxto match the componentβs currentaria-labelstrings for namespace/cluster navigation buttons.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| web/src/lib/cache/tests/worker.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/lib/cache/tests/cache-coverage.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/lib/tests/kubectlProxy.core.resources.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/lib/tests/kubectlProxy.additional.edge.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/hooks/mcp/tests/storage.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/hooks/mcp/tests/shared-coverage.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/hooks/mcp/tests/networking.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/hooks/mcp/tests/kagenti.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/hooks/mcp/tests/kagent_crds.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/hooks/tests/useUniversalStats.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/hooks/tests/useUniversalStats.hook.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/hooks/tests/useTokenUsage.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/hooks/tests/useSnoozeHooks.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/hooks/tests/useDeployMissions.test.ts | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/contexts/tests/AlertsContext.wave2.test.tsx | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/contexts/tests/AlertsContext.core.test.tsx | Remove empty stub test file that caused βNo test suite foundβ. |
| web/src/components/drilldown/views/tests/PodDrillDown.test.tsx | Update button selectors to match current aria-label strings (βView namespace β¦β, βView cluster β¦β). |
| web/src/components/clusters/components/tests/ClusterCardList.test.tsx | Update refresh button selectors and adjust loading-state assertions. |
| const cluster = createMockCluster({ | ||
| nodeCount: undefined, | ||
| cpuCores: undefined, | ||
| podCount: undefined, | ||
| loading: true, |
|
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: |
β¦tton The ActionTooltipWrapper span carries role="button" (added in PR #19270), which caused getByRole('button', { name: /common\.refresh/i }) to match both the wrapper span and the inner <button> β throwing "Found multiple elements". Fix mirrors the pattern already used in ClusterCardFull.test.tsx: use getAllByRole(...).find(el => el.tagName === 'BUTTON')! to target the actual <button> element. Signed-off-by: hive-scanner <hive-scanner@kubestellar.io> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
β¦tton (#19284) The ActionTooltipWrapper span carries role="button" (added in PR #19270), which caused getByRole('button', { name: /common\.refresh/i }) to match both the wrapper span and the inner <button> β throwing "Found multiple elements". Fix mirrors the pattern already used in ClusterCardFull.test.tsx: use getAllByRole(...).find(el => el.tagName === 'BUTTON')! to target the actual <button> element. Signed-off-by: hive-scanner <hive-scanner@kubestellar.io> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes #19268
Repairs 20 test failures from Coverage Suite run #3819:
Root causes:
16 empty test stubs β Previous refactoring split large test files into focused modules but left behind empty stub files (6-7 lines, comments only). Vitest reports these as "No test suite found" failures. Fixed by deleting all 16 stubs.
ClusterCardList.test.tsx (3 failures) β Button selectors referenced old
refreshClusterDataaria-label, but the component now usest('common.refresh')for the button's aria-label. Also, the loading state test usedqueryByText('-')which found multiple matching elements. Fixed selectors and usedgetAllByText.PodDrillDown.test.tsx (1 failure) β Test looked for button with name matching i18n key
/drilldown.fields.namespace/but the component uses explicitaria-label="View namespace ns1". Fixed selectors to match actual aria-labels.Files deleted (empty stubs):
useDeployMissions.test.ts,useUniversalStats.hook.test.ts,useUniversalStats.test.tsuseSnoozeHooks.test.ts,useTokenUsage.test.tsshared-coverage.test.ts,storage.test.ts,kagent_crds.test.ts,kagenti.test.ts,networking.test.tskubectlProxy.additional.edge.test.ts,kubectlProxy.core.resources.test.tscache-coverage.test.ts,worker.test.tsAlertsContext.core.test.tsx,AlertsContext.wave2.test.tsxFiles modified:
ClusterCardList.test.tsxβ updated button selectorsPodDrillDown.test.tsxβ updated namespace/cluster button selectors