Skip to content

test(vue-query/utils): assert 'updateState' sets keys missing from the update to 'undefined' - #11609

Open
sukvvon wants to merge 1 commit into
mainfrom
test/vue-query-utils-updatestate-undefined
Open

sukvvon wants to merge 1 commit into
mainfrom
test/vue-query-utils-updatestate-undefined

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 24, 2026

Copy link
Copy Markdown
Member

🎯 Changes

should remove non existing keys claimed updateState removes keys missing from the update, but updateState assigns undefined to them. The test passed only because toEqual ignores undefined properties.

Renames it to should set keys missing from the update to undefined and asserts with toStrictEqual against option3: undefined.

✅ 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 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
    • Updated test coverage for state updates: keys omitted from an update are expected to remain present with undefined values. No end-user-facing feature changes are included.

@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 Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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

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: 87128fba-4281-417d-a00d-131a7c8f0758

📥 Commits

Reviewing files that changed from the base of the PR and between 7bfe142 and 5efead0.

📒 Files selected for processing (1)
  • packages/vue-query/src/__tests__/utils.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The updateState test now expects keys absent from the update object to remain in the resulting object with undefined values. The assertion uses toStrictEqual to check for the explicit property.

Changes

Update state test

Layer / File(s) Summary
Missing-key expectation
packages/vue-query/src/__tests__/utils.test.ts
The test name and expected object now reflect that keys missing from the update are present with undefined values. The assertion uses toStrictEqual.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 5efea

The change strengthens the test to verify that a missing update key remains present with an undefined value; this matches the implementation, with no actionable merge risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the test change: it verifies that updateState sets missing keys to undefined.
Description check ✅ Passed The description follows the repository template. It explains the change and motivation, completes the checklist, and identifies the change as docs/CI/dev-only with 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 1…
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

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.

@nx-cloud

nx-cloud Bot commented Sep 24, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 5efead0

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

☁️ Nx Cloud last updated this comment at 2026-09-24 05:11:14 UTC

@pkg-pr-new

pkg-pr-new Bot commented Sep 24, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 5efead0

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.87 KB (0%)
react minimal 8.85 KB (0%)

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