Skip to content

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

Open
sukvvon wants to merge 1 commit into
mainfrom
sukvvon/angular-query-restore-enabled-toggle-test
Open

sukvvon wants to merge 1 commit into
mainfrom
sukvvon/angular-query-restore-enabled-toggle-test

Conversation

@sukvvon

@sukvvon sukvvon commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

🎯 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.

@sukvvon sukvvon self-assigned this Dec 3, 2026
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

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 name Status Explanation
Title check Passed 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 rela…
Description check Passed 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 …
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.
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 5fb7cb7 and 2220b38.

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.

@changeset-bot

changeset-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2220b38

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

@nx-cloud

nx-cloud Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 2220b38

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

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

@pkg-pr-new

pkg-pr-new Bot commented Dec 3, 2026

Copy link
Copy Markdown
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

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.97 KB (0%)
react minimal 8.71 KB (0%)

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

🟩 Patch bumps

Package Version Reason
@tanstack/query-core 5.108.4 → 5.108.5 Changeset
@tanstack/query-devtools 5.108.4 → 5.108.5 Changeset
@tanstack/angular-query 5.108.4 → 5.108.5 Dependent
@tanstack/angular-query-devtools 5.108.4 → 5.108.5 Dependent
@tanstack/angular-query-persist-client 5.108.4 → 5.108.5 Dependent
@tanstack/eslint-plugin-query 5.108.4 → 5.108.5 Dependent
@tanstack/lit-query 0.2.44 → 0.2.45 Dependent
@tanstack/preact-query 5.108.4 → 5.108.5 Dependent
@tanstack/preact-query-devtools 5.108.4 → 5.108.5 Dependent
@tanstack/preact-query-persist-client 5.108.4 → 5.108.5 Dependent
@tanstack/query-async-storage-persister 5.108.4 → 5.108.5 Dependent
@tanstack/query-broadcast-client-experimental 5.108.4 → 5.108.5 Dependent
@tanstack/query-persist-client-core 5.108.4 → 5.108.5 Dependent
@tanstack/query-sync-storage-persister 5.108.4 → 5.108.5 Dependent
@tanstack/react-query 5.108.4 → 5.108.5 Dependent
@tanstack/react-query-devtools 5.108.4 → 5.108.5 Dependent
@tanstack/react-query-next-experimental 5.108.4 → 5.108.5 Dependent
@tanstack/react-query-persist-client 5.108.4 → 5.108.5 Dependent
@tanstack/solid-query 5.108.4 → 5.108.5 Dependent
@tanstack/solid-query-devtools 5.108.4 → 5.108.5 Dependent
@tanstack/solid-query-persist-client 5.108.4 → 5.108.5 Dependent
@tanstack/svelte-query 6.4.7 → 6.4.8 Dependent
@tanstack/svelte-query-devtools 6.4.7 → 6.4.8 Dependent
@tanstack/svelte-query-persist-client 6.4.7 → 6.4.8 Dependent
@tanstack/vue-query 5.108.4 → 5.108.5 Dependent
@tanstack/vue-query-devtools 6.4.7 → 6.4.8 Dependent

This branch has not been deployed

No deployments
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