Skip to content

🐛 Fix Auto-QA issues: button patterns and missing test coverage#4172

Merged
clubanderson merged 1 commit intomainfrom
fix/auto-qa-final
Apr 1, 2026
Merged

🐛 Fix Auto-QA issues: button patterns and missing test coverage#4172
clubanderson merged 1 commit intomainfrom
fix/auto-qa-final

Conversation

@clubanderson
Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • npx tsc --noEmit passes
  • All 14 new tests pass (npx vitest run)
  • CI build/lint pass

Closes #4164
Closes #4168

Replace raw <button> elements in Tour.tsx and Onboarding.tsx with the
shared Button component for consistent styling (#4164). Add smoke
tests for 12 untested components: Tour, Onboarding, CardHistory,
HelmReleases, Deployments, RewardsPanel, GitHubInvite, LinkedInShare,
CommandLineTab, ImportTab, PodExecTerminal, SlackNotificationSettings
(#4168).

Closes #4164
Closes #4168

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Copilot AI review requested due to automatic review settings April 1, 2026 14:38
@kubestellar-prow kubestellar-prow bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Apr 1, 2026
@clubanderson clubanderson merged commit c670702 into main Apr 1, 2026
7 checks passed
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 1, 2026

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit b4e418b
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/69cd2dedee960800087bec5e
😎 Deploy Preview https://deploy-preview-4172.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

@kubestellar-prow kubestellar-prow bot deleted the fix/auto-qa-final branch April 1, 2026 14:38
@kubestellar-prow kubestellar-prow bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 Auto-QA findings by standardizing button usage in onboarding UI and adding basic smoke tests to cover previously untested components.

Changes:

  • Replaced several raw <button> elements with the shared Button component in onboarding-related UI for consistent styling/behavior.
  • Added Vitest smoke tests for multiple UI components to close gaps in component-level test coverage.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
web/src/components/terminal/tests/PodExecTerminal.test.tsx Adds a non-rendering smoke test validating the PodExecTerminal export with xterm mocked.
web/src/components/settings/sections/tests/SlackNotificationSettings.test.tsx Adds a render smoke test for Slack notification settings with supporting mocks.
web/src/components/rewards/tests/RewardsPanel.test.tsx Adds an import-based smoke test for RewardsPanel with hooks mocked.
web/src/components/rewards/tests/LinkedInShare.test.tsx Adds render smoke tests for LinkedIn share button/card with hooks mocked.
web/src/components/rewards/tests/GitHubInvite.test.tsx Adds a render smoke test for the GitHub invite button with hooks mocked.
web/src/components/onboarding/tests/Tour.test.tsx Adds render smoke tests for Tour components with tour hook mocked.
web/src/components/onboarding/tests/Onboarding.test.tsx Adds an import-based smoke test for the Onboarding export with routing/auth mocked.
web/src/components/onboarding/Tour.tsx Replaces raw buttons with the shared Button component in tour overlay/trigger UI.
web/src/components/onboarding/Onboarding.tsx Replaces raw buttons with the shared Button component in onboarding navigation/ranking UI.
web/src/components/history/tests/CardHistory.test.tsx Adds a render smoke test for CardHistory with history hook mocked.
web/src/components/helm/tests/HelmReleases.test.tsx Adds an import-based smoke test for HelmReleases with dashboard hooks mocked.
web/src/components/deployments/tests/Deployments.test.tsx Adds an import-based smoke test for Deployments with cached-data hooks mocked.
web/src/components/clusters/add-cluster/tests/ImportTab.test.tsx Adds a render smoke test for ImportTab.
web/src/components/clusters/add-cluster/tests/CommandLineTab.test.tsx Adds a render smoke test for CommandLineTab.

)}
icon={<LogoWithStar className="w-5 h-5" />}
className={cn(!hasCompletedTour && 'animate-pulse')}
title="Take a tour"
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

When hasCompletedTour is true, this button becomes icon-only (no visible text). title is not a reliable accessible name for screen readers. Add an aria-label (or include a visually-hidden text node) so the trigger remains accessible in the completed state.

Suggested change
title="Take a tour"
title="Take a tour"
aria-label="Take the tour"

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +31
vi.mock('../../../lib/demoMode', () => ({
isDemoMode: () => true, getDemoMode: () => true, isNetlifyDeployment: false,
isDemoModeForced: false, canToggleDemoMode: () => true, setDemoMode: vi.fn(),
toggleDemoMode: vi.fn(), subscribeDemoMode: () => () => {},
isDemoToken: () => true, hasRealToken: () => false, setDemoToken: vi.fn(),
isFeatureEnabled: () => true,
}))

vi.mock('../../../hooks/useDemoMode', () => ({
getDemoMode: () => true, default: () => true,
useDemoMode: () => ({ isDemoMode: true, toggleDemoMode: vi.fn(), setDemoMode: vi.fn() }),
hasRealToken: () => false, isDemoModeForced: false, isNetlifyDeployment: false,
canToggleDemoMode: () => true, isDemoToken: () => true, setDemoToken: vi.fn(),
setGlobalDemoMode: vi.fn(),
}))

vi.mock('../../../lib/analytics', () => ({
emitNavigate: vi.fn(), emitLogin: vi.fn(), emitEvent: vi.fn(), analyticsReady: Promise.resolve(),
emitAddCardModalOpened: vi.fn(), emitCardExpanded: vi.fn(), emitCardRefreshed: vi.fn(),
emitLinkedInShare: vi.fn(),
}))

vi.mock('../../../hooks/useTokenUsage', () => ({
useTokenUsage: () => ({ usage: { total: 0, remaining: 0, used: 0 }, isLoading: false }),
tokenUsageTracker: { getUsage: () => ({ total: 0, remaining: 0, used: 0 }), trackRequest: vi.fn(), getSettings: () => ({ enabled: false }) },
}))
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

This same mock setup (demo mode, analytics, token usage, i18n) is duplicated across many new smoke tests. To reduce upkeep and avoid widespread breakage when any of these modules change, consider extracting these into a shared test helper or a common Vitest setup file and reusing them across the test suite.

Copilot uses AI. Check for mistakes.
describe('GitHubInviteButton', () => {
it('renders without crashing', () => {
const { container } = render(<GitHubInviteButton onClick={vi.fn()} />)
expect(container).toBeTruthy()
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

expect(container).toBeTruthy() is effectively a no-op because container will always be truthy if render() returns. If the intent is a smoke test, consider asserting something observable (e.g., getByRole('button')), or at least expect(container.firstChild).not.toBeNull() to ensure something actually rendered.

Suggested change
expect(container).toBeTruthy()
expect(container.firstChild).not.toBeNull()

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

👋 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
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@clubanderson
Copy link
Copy Markdown
Collaborator Author

🔄 Auto-Applying Copilot Code Review

Copilot code review found 2 code suggestion(s) and 1 general comment(s).

@copilot Please apply all of the following code review suggestions:

  • web/src/components/onboarding/Tour.tsx (line 459): title="Take a tour" aria-label="Take the tour"
  • web/src/components/rewards/__tests__/GitHubInvite.test.tsx (line 55): expect(container.firstChild).not.toBeNull()

Also address these general comments:

  • web/src/components/rewards/__tests__/RewardsPanel.test.tsx (line 31): This same mock setup (demo mode, analytics, token usage, i18n) is duplicated across many new smoke tests. To reduce upke

Push all fixes in a single commit. Run cd web && npm run build && npm run lint before committing.


Auto-generated by copilot-review-apply workflow.

clubanderson added a commit that referenced this pull request Apr 1, 2026
- Tour.tsx: Add aria-label on icon-only tour button (#4172)
- ConsoleOfflineDetectionCard: Hoist GPU_CLUSTER_EXHAUSTION_THRESHOLD
  to module scope, fix comments "80%+" → ">80%" (#4185)
- coverage-hourly.yml: Replace always() with success check to avoid
  noisy merge-coverage failures when shards fail (#4185)

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Apr 1, 2026
…ow (#4186)

- Tour.tsx: Add aria-label on icon-only tour button (#4172)
- ConsoleOfflineDetectionCard: Hoist GPU_CLUSTER_EXHAUSTION_THRESHOLD
  to module scope, fix comments "80%+" → ">80%" (#4185)
- coverage-hourly.yml: Replace always() with success check to avoid
  noisy merge-coverage failures when shards fail (#4185)

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Apr 1, 2026
)

* 🐛 Address Copilot comments: tour a11y, GPU threshold, coverage workflow

- Tour.tsx: Add aria-label on icon-only tour button (#4172)
- ConsoleOfflineDetectionCard: Hoist GPU_CLUSTER_EXHAUSTION_THRESHOLD
  to module scope, fix comments "80%+" → ">80%" (#4185)
- coverage-hourly.yml: Replace always() with success check to avoid
  noisy merge-coverage failures when shards fail (#4185)

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* 🌱 Add debug logging for screenshot upload flow in feedback dialog

All logs use console.debug with [Screenshot] prefix for easy filtering
in browser DevTools. Logs at each stage:
- File selection (drag, drop, paste, file picker): file count, types, sizes
- FileReader: loaded data URI length, errors
- Paste: clipboard item types, getAsFile results
- Submit: screenshot count, sizes, timeout, success/failure details

This helps team members diagnose why screenshot uploads fail on their
machines while working on the reporter's machine.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

---------

Signed-off-by: Andrew Anderson <andy@clubanderson.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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Auto-QA] Components missing test coverage [Auto-QA] Inconsistent component patterns detected

3 participants