test({react,preact}-query/useMutation): split 'should handle conditional logic based on mutate success or failure' into separate success and error tests#10948
Conversation
…nal logic based on mutate success or failure' into separate success and error tests
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo test files ( ChangesuseMutation test refactor
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ 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)
Comment |
|
View your CI Pipeline Execution ↗ for commit e915b4d
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
🎯 Changes
The
should handle conditional logic based on mutate success or failuretest bundled two independent scenarios into one block: a single component rendered both asubmitbutton (mutates withshouldFail: false) and asubmit failbutton (mutates withshouldFail: true), then asserted the success path and the error path sequentially. These are unrelated outcomes, so each is split into its own focused test.should set success message from mutate callbacks when mutation succeeds(only thesubmitbutton + success assertion) andshould set error message from mutate callbacks when mutation fails(only thesubmit failbutton + error assertion).react-queryandpreact-query, whoseuseMutationtests are kept in sync.No assertions are lost — each new test keeps the exact expectation for its path. Both packages'
useMutationsuites pass.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit