test({react,preact}-query-devtools): assert the forwarded 'onClose' callback in the panel instead of 'expect.any(Function)'#11029
Conversation
…allback in the panel instead of 'expect.any(Function)'
|
View your CI Pipeline Execution ↗ for commit 2038463
☁️ 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. |
|
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)
📝 WalkthroughWalkthroughTest files for PreactQueryDevtoolsPanel and ReactQueryDevtoolsPanel were updated to strengthen onClose-related assertions: forwarding tests now check the exact callback, and default-omission tests now verify the forwarded value is a function that returns undefined when invoked. ChangesonClose Test Assertion Updates
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
size-limit report 📦
|
🎯 Changes
The panel's
onClosetests both assertedexpect.any(Function), so the "forward" and "default" cases were indistinguishable and could not catch a regression in theprops.onClose ?? (() => {})defaulting logic (any function satisfies the assertion).onClosecallback is forwarded (toHaveBeenCalledWith(onClose)) instead of any function.undefined) instead of any function.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit