Skip to content

test(query-core/queriesObserver): add test for 'combineResult' fallback when called without raw argument#10511

Merged
sukvvon merged 1 commit intomainfrom
test/query-core-queriesObserver-combineResult-fallback
Apr 17, 2026
Merged

test(query-core/queriesObserver): add test for 'combineResult' fallback when called without raw argument#10511
sukvvon merged 1 commit intomainfrom
test/query-core-queriesObserver-combineResult-fallback

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 17, 2026

🎯 Changes

Add a test to verify that the combineResult function (returned by getOptimisticResult) falls back to the pre-computed result when called without a raw argument.

This covers the fallback path of r ?? result in getOptimisticResult.

✅ 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
    • Expanded test coverage for query observer combined functionality. Added verification that the combined result feature operates correctly with the observer's default fallback behavior when invoked without explicit arguments, ensuring consistent and reliable query aggregation across diverse usage patterns.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 17, 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: c8d48b97-f4fa-4033-8b80-efd4fb229f00

📥 Commits

Reviewing files that changed from the base of the PR and between dbee9eb and 26e1065.

📒 Files selected for processing (1)
  • packages/query-core/src/__tests__/queriesObserver.test.tsx

📝 Walkthrough

Walkthrough

A new test case was added to verify that QueriesObserver's getOptimisticResult function's getCombined method can be invoked without a raw argument, ensuring it properly returns a combined value using the observer's fallback behavior.

Changes

Cohort / File(s) Summary
QueriesObserver Tests
packages/query-core/src/__tests__/queriesObserver.test.tsx
Added test case verifying getCombined() can be called without a raw argument and returns correctly combined results using fallback behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

package: query-core

Poem

🐰 A test hopped in, so neat and small,
To verify that getCombined works for all!
No raw required, just fallback grace,
Observer combines—a test-case embrace! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a test for the 'combineResult' fallback behavior when called without a raw argument.
Description check ✅ Passed The description includes all required template sections with appropriate content: changes explained clearly, checklist items completed, and release impact properly marked as 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/query-core-queriesObserver-combineResult-fallback

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 17, 2026

View your CI Pipeline Execution ↗ for commit 26e1065

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

☁️ Nx Cloud last updated this comment at 2026-04-17 23:45:09 UTC

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

@sukvvon sukvvon self-assigned this Apr 17, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 17, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 26e1065

@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 658d32b into main Apr 17, 2026
10 checks passed
@sukvvon sukvvon deleted the test/query-core-queriesObserver-combineResult-fallback branch April 17, 2026 23:47
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