Skip to content

test(query-devtools/contexts/PiPContext): add tests for 'requestPipWindow' opening a PiP window and persisting 'pip_open'#10797

Merged
sukvvon merged 1 commit into
mainfrom
test/query-devtools-pipcontext-request-pip-window
May 25, 2026
Merged

test(query-devtools/contexts/PiPContext): add tests for 'requestPipWindow' opening a PiP window and persisting 'pip_open'#10797
sukvvon merged 1 commit into
mainfrom
test/query-devtools-pipcontext-request-pip-window

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented May 25, 2026

🎯 Changes

Cover the three behaviors that requestPipWindow contributes on top of the browser's window.open:

  • should call "window.open" with the expected target and features: verifies the TSQD-Devtools-Panel target name and the width=…,height=…,popup feature string the module chose.
  • should set the "pipWindow" signal to the opened window: verifies that the opened window flows out through the pipWindow accessor consumers read.
  • should persist "pip_open" as "true" to "localStore" after a successful open: verifies the pip_open storage key the module persists so the createEffect can restore PiP across reloads.

To keep the tests free of ! assertions, the file uses a small PiPActor component plus a renderAndAct(action) helper that invokes action(pip) inside a createEffect, mirroring the production pattern where pip() is read in a reactive scope. A stubPipWindow({ overrides? }) helper builds a FakePipWindow and stubs window.open per case so each test only declares the values it needs.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

Warning

Review limit reached

@sukvvon, we couldn't start this review because you've used your available PR reviews for now.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6cd9d95c-f158-4326-8332-31243313908f

📥 Commits

Reviewing files that changed from the base of the PR and between 335975d and b973076.

📒 Files selected for processing (1)
  • packages/query-devtools/src/__tests__/contexts/PiPContext.test.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/query-devtools-pipcontext-request-pip-window

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 25, 2026

View your CI Pipeline Execution ↗ for commit 66c81ae

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 3m 36s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 28s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-25 18:32:54 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

🚀 Changeset Version Preview

2 package(s) bumped directly, 23 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/lit-query 0.2.6 → 0.2.7 Changeset
@tanstack/query-devtools 5.100.14 → 5.100.15 Changeset
@tanstack/angular-query-experimental 5.100.14 → 5.100.15 Dependent
@tanstack/angular-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/eslint-plugin-query 5.100.14 → 5.100.15 Dependent
@tanstack/preact-query 5.100.14 → 5.100.15 Dependent
@tanstack/preact-query-devtools 5.100.14 → 5.100.15 Dependent
@tanstack/preact-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/query-async-storage-persister 5.100.14 → 5.100.15 Dependent
@tanstack/query-broadcast-client-experimental 5.100.14 → 5.100.15 Dependent
@tanstack/query-core 5.100.14 → 5.100.15 Dependent
@tanstack/query-persist-client-core 5.100.14 → 5.100.15 Dependent
@tanstack/query-sync-storage-persister 5.100.14 → 5.100.15 Dependent
@tanstack/react-query 5.100.14 → 5.100.15 Dependent
@tanstack/react-query-devtools 5.100.14 → 5.100.15 Dependent
@tanstack/react-query-next-experimental 5.100.14 → 5.100.15 Dependent
@tanstack/react-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/solid-query 5.100.14 → 5.100.15 Dependent
@tanstack/solid-query-devtools 5.100.14 → 5.100.15 Dependent
@tanstack/solid-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/svelte-query 6.1.33 → 6.1.34 Dependent
@tanstack/svelte-query-devtools 6.1.33 → 6.1.34 Dependent
@tanstack/svelte-query-persist-client 6.1.33 → 6.1.34 Dependent
@tanstack/vue-query 5.100.14 → 5.100.15 Dependent
@tanstack/vue-query-devtools 6.1.33 → 6.1.34 Dependent

…ndow' opening a PiP window and persisting 'pip_open'
@sukvvon sukvvon force-pushed the test/query-devtools-pipcontext-request-pip-window branch from 7b51612 to b973076 Compare May 25, 2026 18:28
@sukvvon sukvvon self-assigned this May 25, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 25, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10797

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10797

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@10797

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10797

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10797

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10797

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10797

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10797

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10797

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10797

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10797

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10797

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10797

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10797

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10797

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10797

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10797

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10797

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10797

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10797

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10797

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10797

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10797

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10797

commit: b973076

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.11 KB (0%)
react minimal 9.08 KB (0%)

@sukvvon sukvvon merged commit 25009cd into main May 25, 2026
9 checks passed
@sukvvon sukvvon deleted the test/query-devtools-pipcontext-request-pip-window branch May 25, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant