[quality] Fix card-config deep schema test to accept componentName alias#20560
Conversation
The UnifiedCardConfig type defines both `component` and `componentName` as valid fields for custom content (componentName is the primary, component is the alias). Newer card configs use `componentName` while older ones use `component`. The test only checked for `component`, causing failures on all newer cards. Fixes #20552 Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
[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 |
✅ Deploy Preview for kubestellarconsole canceled.
|
|
🐝 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. |
There was a problem hiding this comment.
Pull request overview
This PR updates the deep schema test for card configs to recognize the newer componentName field for custom card content (while still supporting the legacy component alias), aligning the assertion with the CardContentCustom type in web/src/lib/unified/types.ts.
Changes:
- Update the “custom content has component name” test to accept either
content.componentorcontent.componentNamefor custom card content.
| const content = c.content as { type: 'custom'; component?: string; componentName?: string } | ||
| const name = content.component || content.componentName | ||
| expect(typeof name).toBe('string') |
❌ Playwright Tests Failed📊 View Full ReportDownload the To view the report locally: # Download and extract playwright-report.zip
npx playwright show-report path/to/playwright-report |
Signed-off-by: kubestellar-hive[bot] <kubestellar-hive[bot]@users.noreply.github.com>
|
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 Verification: cancelledCommit: |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
Test Improvement
Fixes the
custom content has component nameassertion incard-config-deep-schema.test.tswhich was failing for all newer card configs that usecomponentNameinstead ofcomponent.The
UnifiedCardConfigtype (line 255-257 oftypes.ts) defines both:componentName?: string— primary fieldcomponent?: string— alias for componentNameThe test only checked
content.component, missing cards that use the canonicalcomponentNamefield. This caused mass failures acrosscilium_status,gpu_overview,cascade_impact_map,cluster_delta_detector,config_drift_heatmap,resource_imbalance_detector,right_size_advisor,restart_correlation_matrix, and many others.Fix: Check for either
componentORcomponentName(matching the type's documented alias pattern).Fixes #20552
Filed by quality agent (ACMM L4/L6 — full mode)