Fleet UI: Fix ManageSoftwareAutomationsModal test type errors - #48878
Conversation
Root cause: babel-jest strips TS types by erasure without type-checking, so the Jest CI job passed on #48854. The strict check runs inside webpack's ForkTsCheckerWebpackPlugin (webpack.config.js:15), which only fires during `make generate-js` in the build-binaries job — that job apparently didn't gate #48854 and first surfaced the failure on a downstream PR. The test passed partial nested objects to createMockConfig, which accepts Partial<IConfig> — top-level keys may be omitted but each included value must be complete. Filled in the missing required fields so the shapes satisfy IWebhookSettings and IGitOpsModeConfig.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
Pull request overview
Fixes TypeScript type errors in ManageSoftwareAutomationsModal tests by ensuring createMockConfig overrides provide complete values for required nested config objects (since createMockConfig shallow-merges overrides).
Changes:
- Extend the
webhook_settingsoverride in the test to include all required webhook sub-objects (failing_policies_webhook,host_status_webhook,activities_webhook) alongsidevulnerabilities_webhook. - Extend the
gitopsoverride in the test render context to include required fields (repository_url,exceptions) alongsidegitops_mode_enabled.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #48878 +/- ##
==========================================
+ Coverage 68.06% 68.09% +0.02%
==========================================
Files 3694 3694
Lines 234689 234339 -350
Branches 12501 12501
==========================================
- Hits 159748 159574 -174
+ Misses 60597 60445 -152
+ Partials 14344 14320 -24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis change updates test fixtures within a single test file for the ManageSoftwareAutomationsModal component. The mocked Changes
Sequence Diagram(s)Not applicable — changes are limited to test fixture data updates with no observable control flow to diagram. Related issues: None found in provided context. Related PRs: None found in provided context. Suggested labels: frontend, tests Suggested reviewers: None found in provided context. 🐰 A hop through mocks, a tweak so slight, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@claude review |
Issue
Broken test file introduced in #48854 — failing on the
build-binaries > Generate static filesjob (first surfaced on #48871's CI run).Description
babel-jeststrips TS types by erasure without type-checking, so Jest CI passed on Add onURLBlur handler for InputField #48854. Strict TS check runs inside webpack'sForkTsCheckerWebpackPlugin(webpack.config.js:15), which only fires duringmake generate-jsin the build-binaries job — that job apparently didn't gate Add onURLBlur handler for InputField #48854 and first surfaced the failure on a downstream PR.createMockConfig, which acceptsPartial<IConfig>— top-level keys may be omitted, but each included value must be complete.webhook_settingsneededfailing_policies_webhook,host_status_webhook, andactivities_webhookalongside the providedvulnerabilities_webhook;gitopsneededrepository_urlandexceptionsalongsidegitops_mode_enabled.createMockConfig(...)call sites inManageSoftwareAutomationsModal.tests.tsx.Screenrecording
Testing
Summary by CodeRabbit