Skip to content

[scanner] πŸ› fix: repair 20 test failures β€” remove empty stubs and fix stale selectors#19270

Merged
clubanderson merged 18 commits into
mainfrom
scanner/fix-19268
Jun 20, 2026
Merged

[scanner] πŸ› fix: repair 20 test failures β€” remove empty stubs and fix stale selectors#19270
clubanderson merged 18 commits into
mainfrom
scanner/fix-19268

Conversation

@clubanderson

Copy link
Copy Markdown
Collaborator

Fixes #19268

Repairs 20 test failures from Coverage Suite run #3819:

Root causes:

  1. 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.

  2. ClusterCardList.test.tsx (3 failures) β€” Button selectors referenced old refreshClusterData aria-label, but the component now uses t('common.refresh') for the button's aria-label. Also, the loading state test used queryByText('-') which found multiple matching elements. Fixed selectors and used getAllByText.

  3. PodDrillDown.test.tsx (1 failure) β€” Test looked for button with name matching i18n key /drilldown.fields.namespace/ but the component uses explicit aria-label="View namespace ns1". Fixed selectors to match actual aria-labels.

Files deleted (empty stubs):

  • useDeployMissions.test.ts, useUniversalStats.hook.test.ts, useUniversalStats.test.ts
  • useSnoozeHooks.test.ts, useTokenUsage.test.ts
  • shared-coverage.test.ts, storage.test.ts, kagent_crds.test.ts, kagenti.test.ts, networking.test.ts
  • kubectlProxy.additional.edge.test.ts, kubectlProxy.core.resources.test.ts
  • cache-coverage.test.ts, worker.test.ts
  • AlertsContext.core.test.tsx, AlertsContext.wave2.test.tsx

Files modified:

  • ClusterCardList.test.tsx β€” updated button selectors
  • PodDrillDown.test.tsx β€” updated namespace/cluster button selectors

- 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>
Copilot AI review requested due to automatic review settings June 20, 2026 08:30
@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 57f2c91
πŸ” Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a364fab16184e0008950135
😎 Deploy Preview https://deploy-preview-19270.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 mikespreitzer 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.

@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 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.tsx to use current refresh button accessible names and avoid ambiguous '-' text querying.
  • Update PodDrillDown.test.tsx to match the component’s current aria-label strings 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.

Comment on lines 134 to 138
const cluster = createMockCluster({
nodeCount: undefined,
cpuCores: undefined,
podCount: undefined,
loading: true,
@clubanderson clubanderson merged commit 9c99cb1 into main Jun 20, 2026
41 of 42 checks passed
@kubestellar-prow kubestellar-prow Bot deleted the scanner/fix-19268 branch June 20, 2026 08:35
@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 9c99cb12da16afcf1bedbf3a243160f6cc1190ed.

@github-actions

Copy link
Copy Markdown
Contributor

βœ… Post-Merge Verification: passed

Commit: 9c99cb12da16afcf1bedbf3a243160f6cc1190ed
Specs run: Clusters.spec.ts DrillDown.spec.ts smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/27865801615

clubanderson added a commit that referenced this pull request Jun 20, 2026
…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>
clubanderson added a commit that referenced this pull request Jun 20, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

πŸ› 20 test failure(s) in Coverage Suite run #3819

2 participants