Github test fix: Fix SetupAssistant.tests.tsx failing in CI - #45378
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #45378 +/- ##
==========================================
- Coverage 66.73% 66.73% -0.01%
==========================================
Files 2732 2732
Lines 218551 218569 +18
Branches 10803 10681 -122
==========================================
- Hits 145857 145852 -5
- Misses 59480 59504 +24
+ Partials 13214 13213 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
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)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR updates the SetupAssistant test for the "MDM isn't configured" scenario by adding an MSW GET handler for the defaultEnrollmentProfileUrl endpoint that returns JSON 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Pull request overview
Fixes a CI-only/flaky failure in SetupAssistant.tests.tsx by ensuring the test suite mocks all network calls triggered by the SetupAssistant component (including the follow-up fetch for the default enrollment profile when the team profile returns 404).
Changes:
- Adds an MSW mock handler for the default setup enrollment profile endpoint in the “MDM isn’t configured” test case.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Description
From Claude
CI timing
The most likely answer is that commit eb661f9 (which added the default enrollment profile fetch) introduced the potential for this test to fail, but it only flakes under slower CI conditions. The fix is correct either way — a test should mock everything its component fetches.
Testing
Summary by CodeRabbit