test(query-devtools/contexts/PiPContext): add tests for 'requestPipWindow' opening a PiP window and persisting 'pip_open'#10797
Conversation
|
Warning Review limit reached
Your plan includes 5 reviews of capacity. Refill in 13 minutes and 29 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit 66c81ae
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview2 package(s) bumped directly, 23 bumped as dependents. 🟩 Patch bumps
|
…ndow' opening a PiP window and persisting 'pip_open'
7b51612 to
b973076
Compare
size-limit report 📦
|
🎯 Changes
Cover the three behaviors that
requestPipWindowcontributes on top of the browser'swindow.open:should call "window.open" with the expected target and features: verifies theTSQD-Devtools-Paneltarget name and thewidth=…,height=…,popupfeature string the module chose.should set the "pipWindow" signal to the opened window: verifies that the opened window flows out through thepipWindowaccessor consumers read.should persist "pip_open" as "true" to "localStore" after a successful open: verifies thepip_openstorage key the module persists so the createEffect can restore PiP across reloads.To keep the tests free of
!assertions, the file uses a smallPiPActorcomponent plus arenderAndAct(action)helper that invokesaction(pip)inside acreateEffect, mirroring the production pattern wherepip()is read in a reactive scope. AstubPipWindow({ overrides? })helper builds aFakePipWindowand stubswindow.openper case so each test only declares the values it needs.✅ Checklist
pnpm run test:pr.🚀 Release Impact