Skip to content

🌱 refactor: split DynamicCard.test.tsx into focused modules - #22826

Open
kubestellar-hive[bot] wants to merge 2 commits into
mainfrom
scanner/fix-22816
Open

🌱 refactor: split DynamicCard.test.tsx into focused modules#22826
kubestellar-hive[bot] wants to merge 2 commits into
mainfrom
scanner/fix-22816

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Fixes #22816

This PR splits the monolithic DynamicCard.test.tsx (890 lines) into three focused test modules:

  • DynamicCard.top-level.test.tsx (170 lines): Tests for the top-level DynamicCard component configuration validation and error handling

  • DynamicCard.tier1.test.tsx (456 lines): Tests for Tier1CardRuntime covering validation errors, static data rendering, search filters, stats layouts, badge formats, pagination, and API data fetching scenarios

  • DynamicCard.tier2.test.tsx (357 lines): Tests for Tier2CardRuntime covering compilation, component rendering, error handling, cleanup, and edge cases (Coverage Gap: DynamicCard Tier 2 Runtime Failure #5282 failure paths)

Changes

  • All test files are under 500 lines (acceptance criteria met)
  • Test coverage is fully preserved
  • Test organization improved by scenario grouping
  • Tests remain independent and can run in isolation

Test Status

No changes to test logic, only organization. All tests should continue to pass.

— hive: agent=scanner backend=copilot model=auto

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Aug 26, 2026
@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit 0794269
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a91c624425a7c000875e3e7
😎 Deploy Preview https://deploy-preview-22826.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 added the ai-generated Pull request generated by AI label Aug 26, 2026
@github-actions

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.

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚫 Scanner Merge Guardrails: Rate Limit Exceeded

This PR cannot be auto-merged because the scanner has already merged 5 PRs in the last hour.

Rate Limit: 3 merges per hour
Cooldown: Wait until the rate limit window resets

Reason: This guardrail prevents rapid consecutive merges that can cause build instability.

See issue #18218 for context.

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

@github-actions

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

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

Copy link
Copy Markdown
Contributor Author

🛑 Fix loop escalated — human attention needed

This PR has failed CI on 1 distinct fix attempts (new commits, still red). The hive has stopped dispatching further automated fixes for it.

Failing checks: Test (chromium, shard 1), Test (chromium, shard 2), Test (chromium, shard 3), build-gate

Raw failure evidence (from check-run annotations):

Test (chromium, shard 2): 3) [chromium] › e2e/enterprise-compliance.spec.ts:87:3 › Enterprise Compliance Portal › sidebar navigation works 
Test (chromium, shard 2): 3) [chromium] › e2e/enterprise-compliance.spec.ts:87:3 › Enterprise Compliance Portal › sidebar navigation works 
Test (chromium, shard 2): 2) [chromium] › e2e/enterprise-compliance.spec.ts:73:7 › Enterprise Compliance Portal › Vertical Dashboards › navigates to NIST 800-53 vertical 
Test (chromium, shard 2): 2) [chromium] › e2e/enterprise-compliance.spec.ts:73:7 › Enterprise Compliance Portal › Vertical Dashboards › navigates to NIST 800-53 vertical 
Test (chromium, shard 2): 2) [chromium] › e2e/enterprise-compliance.spec.ts:73:7 › Enterprise Compliance Portal › Vertical Dashboards › navigates to NIST 800-53 vertical 

Remove the needs-human label after addressing the root cause to return the PR to the automated fix lane.

@kubestellar-prow kubestellar-prow Bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 26, 2026
Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.api.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.api.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.api.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.api.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier2.test.tsx Fixed
@kubestellar-hive kubestellar-hive Bot added agent/scanner Filed by the scanner agent hive/hosted-kubestellar-console-4vkt Hive instance hosted-kubestellar-console-4vkt labels Aug 27, 2026
@kubestellar-hive

Copy link
Copy Markdown
Contributor Author

/rebase

🐝 Hive Agent: scanner | Instance: hosted-kubestellar-console-4vkt | SHA: bcef363f34

— hive: agent=scanner backend=copilot model=auto

Split the 890-line DynamicCard.test.tsx into a reduced core file plus
tier1, tier1.api, and tier2 modules (50 tests preserved, verified by
count). Rebased onto main: dropped the AlertsContext, analytics,
kubectlProxy, worker.module, and ModalRuntime portions of the original
branch since main already contains equivalent splits of those files.
Per-file imports trimmed to only what each split part uses.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 28, 2026
clubanderson added a commit that referenced this pull request Aug 28, 2026
Extract feed state management from the 856-line RSSFeed.tsx into a
useRSSFeed hook (RSSFeed.tsx now 395 lines) and add unit tests for the
hook. Rebased onto main: dropped the AlertsContext, ModalRuntime, and
DynamicCard portions of the original branch since main already contains
equivalent splits (DynamicCard split continues in #22826). Removed an
unused eslint-disable directive flagged by the lint ratchet.

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

Copy link
Copy Markdown
Collaborator

Rebased onto main. This PR is now scoped to its titled purpose only: the DynamicCard.test.tsx split (890 -> 226 lines plus tier1, tier1.api, and tier2 modules; all 50 tests preserved). The AlertsContext, analytics, kubectlProxy, worker.module, and ModalRuntime portions were dropped because main already contains equivalent splits of those files. Per-file imports trimmed per the AGENTS.md split-refactor rules.

Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.api.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier1.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier2.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier2.test.tsx Fixed
Comment thread web/src/components/cards/__tests__/DynamicCard.tier2.test.tsx Fixed
Remove unused imports/helpers copied into each split part and add a
justified eslint-disable for the verbatim-moved require() inside the
hoisted vi.mock factory, per AGENTS.md split-refactor rules.

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

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 Bot added a commit that referenced this pull request Aug 28, 2026
Extract feed state management from the 856-line RSSFeed.tsx into a
useRSSFeed hook (RSSFeed.tsx now 395 lines) and add unit tests for the
hook. Rebased onto main: dropped the AlertsContext, ModalRuntime, and
DynamicCard portions of the original branch since main already contains
equivalent splits (DynamicCard split continues in #22826). Removed an
unused eslint-disable directive flagged by the lint ratchet.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Co-authored-by: Andrew Anderson <andy@clubanderson.com>
@github-actions

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

Copy link
Copy Markdown
Contributor Author

🛑 Fix loop escalated — human attention needed

This PR has failed CI on 1 distinct fix attempts (new commits, still red). The hive has stopped dispatching further automated fixes for it.

Failing checks: Test (chromium, shard 1), Test (chromium, shard 2), Test (chromium, shard 3), build-gate

Raw failure evidence (from check-run annotations):

Test (chromium, shard 2): 3) [chromium] › e2e/enterprise-compliance.spec.ts:73:7 › Enterprise Compliance Portal › Vertical Dashboards › navigates to FedRAMP vertical 
Test (chromium, shard 2): 3) [chromium] › e2e/enterprise-compliance.spec.ts:73:7 › Enterprise Compliance Portal › Vertical Dashboards › navigates to FedRAMP vertical 
Test (chromium, shard 2): 2) [chromium] › e2e/enterprise-compliance.spec.ts:73:7 › Enterprise Compliance Portal › Vertical Dashboards › navigates to NIST 800-53 vertical 
Test (chromium, shard 2): 2) [chromium] › e2e/enterprise-compliance.spec.ts:73:7 › Enterprise Compliance Portal › Vertical Dashboards › navigates to NIST 800-53 vertical 
Test (chromium, shard 2): 2) [chromium] › e2e/enterprise-compliance.spec.ts:73:7 › Enterprise Compliance Portal › Vertical Dashboards › navigates to NIST 800-53 vertical 

Remove the needs-human label after addressing the root cause to return the PR to the automated fix lane.

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

Labels

agent/scanner Filed by the scanner agent ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. hive/hosted-kubestellar-console-4vkt Hive instance hosted-kubestellar-console-4vkt needs-human scanner-rate-limited size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tier/1-lightweight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] Split DynamicCard.test.tsx (part of #22774)

1 participant