test(react-query-devtools/ReactQueryDevtools): add tests for forwarding option changes after mount#11019
Conversation
|
View your CI Pipeline Execution ↗ for commit 5db2625
☁️ Nx Cloud last updated this comment at |
|
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 (1)
📝 WalkthroughWalkthroughThis PR adds five new test cases to ReactQueryDevtools.test.tsx that verify prop updates (buttonPosition, position, initialIsOpen, errorTypes, theme) are forwarded to the underlying devtools instance's setter methods when the component rerenders with changed props. ChangesDevtools Rerender Prop-Forwarding Tests
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
…ng option changes after mount
5db2625 to
8fa612f
Compare
size-limit report 📦
|
🎯 Changes
Adds regression tests verifying that
ReactQueryDevtoolsforwards option changes to the underlying devtools instance after mount, not just on the initial render.The existing tests only cover the initial forwarding of options. Each option is wired through its own
useEffectwith a dependency array (e.g.[position, devtools]), so if a dependency is accidentally dropped, the option would silently stop being re-forwarded on update — a case the initial-render tests cannot catch.The new tests use
rerenderto change each prop after mount and assert the corresponding setter is called again:buttonPositionpositioninitialIsOpenerrorTypestheme✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit