Skip to content

test(angular-query-experimental/injectQueries): add test for 'combine' option#10536

Merged
sukvvon merged 1 commit intomainfrom
test/angular-query-inject-queries-combine
Apr 20, 2026
Merged

test(angular-query-experimental/injectQueries): add test for 'combine' option#10536
sukvvon merged 1 commit intomainfrom
test/angular-query-inject-queries-combine

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 20, 2026

🎯 Changes

Adds a test covering the combine branch in inject-queries.ts (line 323), raising the branch coverage from 91.66% to 100%.

What's tested

  • injectQueries with a combine function that merges multiple query results into a single aggregated shape
  • Initial render: combined value reflects the pending state (data: [undefined, undefined], isPending: true)
  • After both queries resolve: combined value reflects the resolved state (data: [1, 2], isPending: false)
  • Reactivity: effect records at least two snapshots as the combined signal updates

Verification

  • @tanstack/angular-query-experimental — 208 tests passed (previously 207)
  • src/inject-queries.ts coverage — Stmts/Branch/Funcs/Lines all 100% (previously branch was 91.66%)

✅ 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 the injectQueries combine callback functionality, verifying correct behavior during initial render and state transitions.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 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: 79047dcc-3566-444c-8d40-4b50cf004f61

📥 Commits

Reviewing files that changed from the base of the PR and between cd6a274 and 5c4566b.

📒 Files selected for processing (1)
  • packages/angular-query-experimental/src/__tests__/inject-queries.test.ts

📝 Walkthrough

Walkthrough

A new test case was added to verify injectQueries behavior with a combine callback, checking initial render state, async resolution after fake timer advancement, and reactive state updates.

Changes

Cohort / File(s) Summary
Test Coverage
packages/angular-query-experimental/src/__tests__/inject-queries.test.ts
Added test case for injectQueries with combine callback configuration, verifying initial pending state, data resolution post-timer advancement, and reactive snapshot captures.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A test blooms bright, combining queries with care,
State changes dance through timers in the air,
Pending turns false, data flows complete,
Reactive snapshots make the test suite sweet! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a test for the 'combine' option in injectQueries, which directly matches the changeset that adds a new test case.
Description check ✅ Passed The description comprehensively covers all required template sections: changes are detailed with specific coverage metrics, the checklist is fully completed with all items marked, and release impact is clearly indicated as docs/CI/dev-only.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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/angular-query-inject-queries-combine

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 20, 2026

View your CI Pipeline Execution ↗ for commit 5c4566b

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

☁️ Nx Cloud last updated this comment at 2026-04-20 16:59:54 UTC

@sukvvon sukvvon self-assigned this Apr 20, 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.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 20, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 5c4566b

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.99 KB (0%)
react minimal 9.02 KB (0%)

@sukvvon sukvvon merged commit 4ae65fa into main Apr 20, 2026
10 checks passed
@sukvvon sukvvon deleted the test/angular-query-inject-queries-combine branch April 20, 2026 17:02
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