Skip to content
Source
Sign inSign up
TanStack/query

test(angular-query/inject-query): restore test for 'enabled' signal turning false and back to true #12731

Opensukvvon(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/12731/headopened View on GitHub

sukvvon(GitHub profile, opens in a new tab)commented

🎯 Changes

Restores the injectQuery test should not fetch while the enabled signal is false, and fetch again once it is truthy, which was dropped when angular-query-experimental became angular-query.

The current tests only cover enabled going from false to true. This test covers turning a fetched query off: while enabled is false, changing the queryKey does not call queryFn and isFetching() stays false; when enabled becomes true again, the query fetches for the new 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
    • Added coverage for query fetching as a signal-derived filter changes between truthy and empty values.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      Adds a test for a signal-controlled enabled option. It verifies query fetches for truthy filters and does not fetch when the filter is empty.

      Changes: Signal-controlled query fetching

      Layer / File(s)Summary
      Verify signal-controlled fetching
      packages/angular-query/src/__tests__/inject-query.test.ts
      The test checks the initial fetch for 'a', no additional fetch for an empty filter, and a second fetch for 'b'.

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

      Change: Other

      Merge Risk: Minimal · up to 2220b

      This PR restores a test for disabling a query after it has fetched. It has no runtime impact and no merge-blocking concern remains.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the test restored for the injectQuery 'enabled' signal turning false and back to true. The raw summary confirms the single test file change matches this. The title is specific and rela…
      Description checkPassedThe description follows the template. It explains the change and its motivation: the test was dropped in a rename and is restored. It explains the coverage gap it fills. The Contributing guide and AI …
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Title check

      Explanation

      The title names the test restored for the injectQuery 'enabled' signal turning false and back to true. The raw summary confirms the single test file change matches this. The title is specific and related to the main change, so it passes. It does not mention that it is a test restoration, but it describes the change adequately.

      Full details: Description check

      Explanation

      The description follows the template. It explains the change and its motivation: the test was dropped in a rename and is restored. It explains the coverage gap it fills. The Contributing guide and AI policy boxes are checked, and the release impact is marked as docs/CI/dev-only. The test-run box is unchecked, but the template allows this when the tests do not apply, and the author did not state that. The description is mostly complete.

      Finishing Touches

      Generate unit tests (beta)

      • Commit to this branch
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      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

      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between 5fb7cb7ee51b6356736cdaa7638036a352f0cf06 and 2220b38239392130f46c628f91d64a359ea2099e.

      Files selected for processing: 1

      • packages/angular-query/src/__tests__/inject-query.test.ts

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

    2. ⚠️ No Changeset found

      Latest commit: 2220b38239392130f46c628f91d64a359ea2099e

      Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

      This PR includes no changesets

      When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

      Click here to learn what changesets are, and how to add one.

      Click here if you're a maintainer who wants to add a changeset to this PR

    3. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit 2220b38239392130f46c628f91d64a359ea2099e

      CommandStatusDurationResult
      nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded3m 47sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded9sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-12-03 12:53:22 UTC

    4. More templates

      @tanstack/angular-query

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

      @tanstack/angular-query-devtools

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

      @tanstack/angular-query-persist-client

      npm i https://pkg.pr.new/@tanstack/angular-query-persist-client@12731

      @tanstack/eslint-plugin-query

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

      @tanstack/lit-query

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

      @tanstack/preact-query

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

      @tanstack/preact-query-devtools

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

      @tanstack/preact-query-persist-client

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

      @tanstack/query-async-storage-persister

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

      @tanstack/query-broadcast-client-experimental

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

      @tanstack/query-core

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

      @tanstack/query-devtools

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

      @tanstack/query-persist-client-core

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

      @tanstack/query-sync-storage-persister

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

      @tanstack/react-query

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

      @tanstack/react-query-devtools

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

      @tanstack/react-query-next-experimental

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

      @tanstack/react-query-persist-client

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

      @tanstack/solid-query

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

      @tanstack/solid-query-devtools

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

      @tanstack/solid-query-persist-client

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

      @tanstack/svelte-query

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

      @tanstack/svelte-query-devtools

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

      @tanstack/svelte-query-persist-client

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

      @tanstack/vue-query

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

      @tanstack/vue-query-devtools

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

      commit: 2220b38

    5. size-limit report 📦

      PathSize
      react full11.97 KB (0%)
      react minimal8.71 KB (0%)
    6. 🚀 Changeset Version Preview

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

      🟩 Patch bumps

      PackageVersionReason
      @tanstack/query-core5.108.4 → 5.108.5Changeset
      @tanstack/query-devtools5.108.4 → 5.108.5Changeset
      @tanstack/angular-query5.108.4 → 5.108.5Dependent
      @tanstack/angular-query-devtools5.108.4 → 5.108.5Dependent
      @tanstack/angular-query-persist-client5.108.4 → 5.108.5Dependent
      @tanstack/eslint-plugin-query5.108.4 → 5.108.5Dependent
      @tanstack/lit-query0.2.44 → 0.2.45Dependent
      @tanstack/preact-query5.108.4 → 5.108.5Dependent
      @tanstack/preact-query-devtools5.108.4 → 5.108.5Dependent
      @tanstack/preact-query-persist-client5.108.4 → 5.108.5Dependent
      @tanstack/query-async-storage-persister5.108.4 → 5.108.5Dependent
      @tanstack/query-broadcast-client-experimental5.108.4 → 5.108.5Dependent
      @tanstack/query-persist-client-core5.108.4 → 5.108.5Dependent
      @tanstack/query-sync-storage-persister5.108.4 → 5.108.5Dependent
      @tanstack/react-query5.108.4 → 5.108.5Dependent
      @tanstack/react-query-devtools5.108.4 → 5.108.5Dependent
      @tanstack/react-query-next-experimental5.108.4 → 5.108.5Dependent
      @tanstack/react-query-persist-client5.108.4 → 5.108.5Dependent
      @tanstack/solid-query5.108.4 → 5.108.5Dependent
      @tanstack/solid-query-devtools5.108.4 → 5.108.5Dependent
      @tanstack/solid-query-persist-client5.108.4 → 5.108.5Dependent
      @tanstack/svelte-query6.4.7 → 6.4.8Dependent
      @tanstack/svelte-query-devtools6.4.7 → 6.4.8Dependent
      @tanstack/svelte-query-persist-client6.4.7 → 6.4.8Dependent
      @tanstack/vue-query5.108.4 → 5.108.5Dependent
      @tanstack/vue-query-devtools6.4.7 → 6.4.8Dependent

Sign in to join this conversation.