Skip to content

test(solid-query-devtools/devtoolsPanel): assert the default 'onClose' is a no-op instead of 'expect.any(Function)'#11030

Merged
sukvvon merged 1 commit into
mainfrom
test/solid-query-devtools-onclose-assertion
Jul 4, 2026
Merged

test(solid-query-devtools/devtoolsPanel): assert the default 'onClose' is a no-op instead of 'expect.any(Function)'#11030
sukvvon merged 1 commit into
mainfrom
test/solid-query-devtools-onclose-assertion

Conversation

@sukvvon

@sukvvon sukvvon commented Jul 4, 2026

Copy link
Copy Markdown
Member

🎯 Changes

The panel's default onClose test asserted expect.any(Function), which passes for any function and cannot catch a regression in the props.onClose ?? (() => {}) defaulting logic.

The test now captures the forwarded argument and verifies it is a callable no-op (invoking it does not throw and returns undefined) instead of any function.

The "forward" test already asserts the exact callback (toHaveBeenCalledWith(onClose)), so it is left as-is.

✅ 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
    • Improved coverage for the devtools panel’s default close handler by verifying the registered callback is a function and that it behaves as expected when invoked.

…' is a no-op instead of 'expect.any(Function)'
@nx-cloud

nx-cloud Bot commented Jul 4, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit b58fbd8

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

☁️ Nx Cloud last updated this comment at 2026-07-04 15:13:12 UTC

@sukvvon sukvvon self-assigned this Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ab6c1ad2-5668-41d6-af0e-f4c37a1a6d26

📥 Commits

Reviewing files that changed from the base of the PR and between 27e680f and b58fbd8.

📒 Files selected for processing (1)
  • packages/solid-query-devtools/src/__tests__/devtoolsPanel.test.tsx

📝 Walkthrough

Walkthrough

This change refines a single unit test for SolidQueryDevtoolsPanel's default onClose behavior, replacing a generic matcher assertion with explicit extraction of the passed argument, confirming it is a function, and verifying it returns undefined when invoked.

Changes

Test refinement for default onClose behavior

Layer / File(s) Summary
onClose default test assertion
packages/solid-query-devtools/src/__tests__/devtoolsPanel.test.tsx
Test now captures the argument passed to setOnClose, asserts it is a function, and confirms invoking it returns undefined, replacing the prior generic matcher expectation.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

  • TanStack/query#10827: Directly related, as it introduced the onClose wiring/default-value test coverage that this PR's assertion refines.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly matches the test update for default onClose behavior.
Description check ✅ Passed Description follows the template and includes changes, checklist, and release impact details.
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.
✨ 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/solid-query-devtools-onclose-assertion

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 4, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: b58fbd8

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

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

@sukvvon sukvvon merged commit bb68fa0 into main Jul 4, 2026
9 checks passed
@sukvvon sukvvon deleted the test/solid-query-devtools-onclose-assertion branch July 4, 2026 15:20
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