Skip to content

test(query-devtools/TanstackQueryDevtools{,Panel}): add tests for setters#10676

Merged
sukvvon merged 1 commit intomainfrom
test/query-devtools-tanstack-query-devtools-and-panel-setters
May 9, 2026
Merged

test(query-devtools/TanstackQueryDevtools{,Panel}): add tests for setters#10676
sukvvon merged 1 commit intomainfrom
test/query-devtools-tanstack-query-devtools-and-panel-setters

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented May 9, 2026

🎯 Changes

Add tests for setter methods in TanstackQueryDevtools and TanstackQueryDevtoolsPanel.

  • TanstackQueryDevtools: 7 cases for 6 setters (setButtonPosition, setPosition, setInitialIsOpen, setErrorTypes, setClient, setTheme) — 6 cases before mount + 1 integration case after mount
  • TanstackQueryDevtoolsPanel: 8 cases for 7 setters (above + setOnClose) — 7 cases before mount + 1 integration case after mount

✅ 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).

Summary by CodeRabbit

  • Tests
    • Added comprehensive test coverage for devtools setter methods to ensure reliable configuration updates before and after component mounting.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9e2295bd-4452-4ab6-8f6b-bb9b6c722999

📥 Commits

Reviewing files that changed from the base of the PR and between a37c003 and 4a03b90.

📒 Files selected for processing (2)
  • packages/query-devtools/src/__tests__/TanstackQueryDevtools.test.tsx
  • packages/query-devtools/src/__tests__/TanstackQueryDevtoolsPanel.test.tsx

📝 Walkthrough

Walkthrough

This PR adds test coverage for setter methods in the TanstackQueryDevtools and TanstackQueryDevtoolsPanel components, verifying that these setters do not throw when called both before mounting and after mounting instances.

Changes

Setter Method Testing

Layer / File(s) Summary
TanstackQueryDevtools Setters
packages/query-devtools/src/__tests__/TanstackQueryDevtools.test.tsx
New test suite validates that setButtonPosition, setPosition, setInitialIsOpen, setErrorTypes, setClient, and setTheme methods do not throw when invoked before mount and after mount scenarios, including setTheme(undefined) edge case.
TanstackQueryDevtoolsPanel Setters
packages/query-devtools/src/__tests__/TanstackQueryDevtoolsPanel.test.tsx
New test suite validates that setButtonPosition, setPosition, setInitialIsOpen, setErrorTypes, setClient, setOnClose, and setTheme methods do not throw when called before and after panel mounting, with proper instance cleanup in finally blocks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With setters tested, both before and after mount,
No errors thrown—each call proven sound,
The devtools dance in harmony profound,
Safe to call whenever—that's what counts! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding tests for setter methods in TanstackQueryDevtools and TanstackQueryDevtoolsPanel components.
Description check ✅ Passed The description follows the required template with all sections completed: detailed changes with specific setter methods listed, checklist items checked off, and release impact marked as dev-only.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/query-devtools-tanstack-query-devtools-and-panel-setters

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 9, 2026

View your CI Pipeline Execution ↗ for commit 07d016c

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

☁️ Nx Cloud last updated this comment at 2026-05-09 08:58:41 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@sukvvon sukvvon force-pushed the test/query-devtools-tanstack-query-devtools-and-panel-setters branch from 07d016c to 4a03b90 Compare May 9, 2026 08:54
@sukvvon sukvvon changed the title test(query-devtools): add tests for setters in 'TanstackQueryDevtools' and 'TanstackQueryDevtoolsPanel' test(query-devtools/TanstackQueryDevtools{,Panel}): add tests for setters May 9, 2026
@sukvvon sukvvon self-assigned this May 9, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 9, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 4a03b90

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

size-limit report 📦

Path Size
react full 12.1 KB (0%)
react minimal 9.07 KB (0%)

@sukvvon sukvvon merged commit 9963b2f into main May 9, 2026
8 checks passed
@sukvvon sukvvon deleted the test/query-devtools-tanstack-query-devtools-and-panel-setters branch May 9, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant