Skip to content

[scanner] fix: stale test assertions in compliance component#20568

Merged
kubestellar-hive[bot] merged 4 commits into
mainfrom
scanner/fix-20555
Jul 8, 2026
Merged

[scanner] fix: stale test assertions in compliance component#20568
kubestellar-hive[bot] merged 4 commits into
mainfrom
scanner/fix-20555

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Fixes #20555

Updates stale test assertions in compliance component tests across 6 test files.

…ests

Restore correct mocking so compliance component tests exercise real
component behaviour rather than the global authFetch safety-net stub.

Root causes (all introduced after the tests were written):
- Jul 6 2026 (#20384): setup.ts added a global vi.mock('../lib/api') stub
  whose authFetch returns '{}' for every call.  Tests that spy on
  globalThis.fetch stopped working because authFetch never reaches
  globalThis.fetch when a module-level mock intercepts it first.
  Affected: ChangeControlAudit, DataResidency, SegregationOfDuties.
  Fix: each file now declares vi.mock('../../lib/api') with an authFetch
  that delegates to globalThis.fetch, overriding the global stub and
  letting the existing vi.spyOn(globalThis, 'fetch') mocks work as before.

- Jul 4 2026 (#20300): ComplianceDrillDown.tsx gained a useDrillDown()
  call (back-navigation feature) that throws when rendered outside a
  DrillDownProvider.  Neither ComplianceDrillDown test file mocked it.
  Fix: added vi.mock for useDrillDown returning a minimal stub in both
  views/ComplianceDrillDown.test.tsx and views/__tests__/ComplianceDrillDown.test.tsx.

- SpiffeStatus component accesses data.stats.* and data.summary.* but
  the test setup() fixture only provided health/entries/federatedDomains,
  causing TypeError on the 'renders without error when data is loaded' test.
  Fix: added stats, summary, and lastCheckTime to the mock data object.

Fixes #20555

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: scanner-bot <scanner-bot@kubestellar.io>
Copilot AI review requested due to automatic review settings July 8, 2026 06:56
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jul 8, 2026

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.

Copilot can't review bot-authored pull requests automatically. A user with Copilot access can request a review manually.

@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit 634cc65
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a4e25dd4620ce00086a5a56
😎 Deploy Preview https://deploy-preview-20568.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 eeshaansa 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

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

👋 Hey @kubestellar-hive[bot] — 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 github-actions Bot added the ai-generated Pull request generated by AI label Jul 8, 2026
@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

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.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

♿ Accessibility Audit (WCAG 2.1 AA)

✅ No WCAG 2.1 AA violations detected in audited routes.


Powered by axe-core. Target: WCAG 2.1 AA compliance.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

❌ Playwright Tests Failed

📊 View Full Report

Download the playwright-report artifact from the workflow run for screenshots and detailed traces.

To view the report locally:

# Download and extract playwright-report.zip
npx playwright show-report path/to/playwright-report

Scanner Bot and others added 3 commits July 8, 2026 04:38
The failing test (e2e/oauth-flow.spec.ts - completes full OAuth chain)
is unrelated to the compliance component changes in this PR.
Retriggering to get a clean run.

Signed-off-by: Scanner Bot <scanner@hive.local>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

❌ Playwright Tests Failed

📊 View Full Report

Download the playwright-report artifact from the workflow run for screenshots and detailed traces.

To view the report locally:

# Download and extract playwright-report.zip
npx playwright show-report path/to/playwright-report

@kubestellar-hive kubestellar-hive Bot merged commit bc98aef into main Jul 8, 2026
42 of 46 checks passed
@kubestellar-prow kubestellar-prow Bot deleted the scanner/fix-20555 branch July 8, 2026 10:50
@github-actions

github-actions Bot commented Jul 8, 2026

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

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: bc98aef8d72ae11498f5c9a389152ce88a62875f
Specs run: Dashboard.spec.ts DrillDown.spec.ts smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/28937003838

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit bc98aef8d72ae11498f5c9a389152ce88a62875f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tier/1-lightweight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] Fix stale test assertions in compliance component tests

1 participant