Skip to content

test(lit-query/{useIsFetching,useIsMutating}): split filter tests into static filters and filters updated on host updates - #11763

Merged
sukvvon merged 2 commits into
mainfrom
test/lit-query-use-is-fetching-mutating-split-filter-tests
Sep 30, 2026
Merged

sukvvon merged 2 commits into
mainfrom
test/lit-query-use-is-fetching-mutating-split-filter-tests

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

Splits the filter test in useIsFetching.test.ts and useIsMutating.test.ts into two tests each:

  • should be able to filter: with static filters, the filtered count only includes the matching query or mutation as they finish.
  • should apply updated filters on host updates: with filters from a function, the count follows the filters after each host update, from the first key to an unmatched key to the second key.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

🚀 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
    • Expanded coverage for query and mutation counts with key-based filters, including cases where multiple operations run at the same time.
    • Added separate checks for static filters and filters that update reactively as the host changes, verifying filtered counts as queries and mutations start and finish.

…o static filters and filters updated on host updates
@sukvvon sukvvon self-assigned this Sep 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

@nx-cloud

nx-cloud Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 388ec76

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

☁️ Nx Cloud last updated this comment at 2026-09-30 17:09:55 UTC

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: Repository: TanStack/query/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 6e8575a4-e81e-46f7-8e8f-293b9ddb9729

📥 Commits

Reviewing files that changed from the base of the PR and between c5dd593 and 388ec76.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: TanStack/query/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 2490cf2c-03f0-4f1b-8034-be905ebce7b8

📥 Commits

Reviewing files that changed from the base of the PR and between d374547 and c5dd593.

📒 Files selected for processing (2)
  • packages/lit-query/src/__tests__/useIsFetching.test.ts
  • packages/lit-query/src/__tests__/useIsMutating.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The lit-query tests now separate static query and mutation filter counts from reactive filter updates. Reactive-filter tests retain assertions for filtered counts.

Changes

Lit Query filter count tests

Layer / File(s) Summary
Fetching filter count tests
packages/lit-query/src/__tests__/useIsFetching.test.ts
The tests check unfiltered and queryKey-filtered counts for two queries. The reactive-filter test checks the filtered count as the filter changes on host updates.
Mutation filter count tests
packages/lit-query/src/__tests__/useIsMutating.test.ts
The tests check unfiltered and mutationKey-filtered counts for two mutations. The reactive-filter test checks the filtered count after host updates.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to c5dd5

This test-only split preserves static count coverage and reactive filter checks without changing runtime behavior. No actionable merge-blocking risk is identified; merge after normal checks pass.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: splitting the useIsFetching and useIsMutating filter tests into static-filter and host-update scenarios.
Description check ✅ Passed The description explains the test changes, lists the relevant scenarios, completes all checklist items, and records that the change has no release impact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 388ec76

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.73 KB (0%)
react minimal 8.58 KB (0%)

@sukvvon
sukvvon merged commit 327f4ab into main Sep 30, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/lit-query-use-is-fetching-mutating-split-filter-tests branch September 30, 2026 17:18
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