test(query-devtools/contexts/PiPContext): add test for 'usePiPWindow' throwing outside a 'PiPProvider'#10796
Conversation
|
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)
📝 WalkthroughWalkthroughA new Vitest test renders a component that calls ChangesPiPContext Provider Error Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
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 d49b47f
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview2 package(s) bumped directly, 23 bumped as dependents. 🟩 Patch bumps
|
size-limit report 📦
|
… throwing outside a 'PiPProvider'
d49b47f to
72bf83e
Compare
🎯 Changes
Open a
src/__tests__/contexts/PiPContext.test.tsx(matching theThemeContext/QueryDevtoolsContextsplits from #10787 / #10793) with one case:usePiPWindowmust throw outside aPiPProvider. This is the hand-written guard the module owns to surface a clear error instead of letting consumers read from a missing context.Use the same
render+ probe-component pattern as the sibling context test files so the helper shape stays consistent across the directory.usePiPWindowwraps the context lookup increateMemo, which Solid evaluates immediately when the probe mounts, so therendercall itself raises the error.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
usePiPWindowproperly throws an error when invoked outside the required context.