Skip to content

test(vue-query/mutationOptions): reorder getter tests to group by feature and unify test descriptions#10478

Merged
sukvvon merged 1 commit intomainfrom
test/vue-query-mutationOptions-reorder-getter-tests
Apr 13, 2026
Merged

test(vue-query/mutationOptions): reorder getter tests to group by feature and unify test descriptions#10478
sukvvon merged 1 commit intomainfrom
test/vue-query-mutationOptions-reorder-getter-tests

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 13, 2026

🎯 Changes

  • Reorder getter tests to be grouped by feature alongside their plain counterparts:
    • Identity tests (plain → getter)
    • useMutation getter test
    • useIsMutating tests (plain → getter, with key → without key)
    • queryClient.isMutating tests (plain → getter, with key → without key)
    • useMutationState tests (plain → getter, with key → without key)
    • Shallow ref tests (plain → getter)
    • Reactivity test
  • Unify test descriptions to follow consistent naming pattern:
    • should work with getter passed to mutationOptions without mutationKeyshould work when used with useMutation (getter without mutationKey in mutationOptions)
    • should work with getter passed to mutationOptions when used with useIsMutatingshould return the number of fetching mutations when used with useIsMutating (getter with mutationKey in mutationOptions)
    • should work with getter passed to mutationOptions when used with useMutationStateshould return mutation states when used with useMutationState (getter with mutationKey in mutationOptions)

No tests added or removed — only position and description changes.

✅ 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
    • Reorganized and renamed mutation-related tests to better verify behavior with reactive and non-reactive mutation keys, ensuring pending-state and mutation results are correctly tracked across timing changes.

Note: Internal test improvements only; no user-facing changes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 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: 50a117c6-690d-4bad-a0d8-e58c7dcb1c42

📥 Commits

Reviewing files that changed from the base of the PR and between 98a5ba0 and 0d45400.

📒 Files selected for processing (1)
  • packages/vue-query/src/__tests__/mutationOptions.test.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/vue-query/src/tests/mutationOptions.test.ts

📝 Walkthrough

Walkthrough

Reorganized and renamed tests in mutationOptions.test.ts: added a useMutation test for getter-produced options without mutationKey, added/relocated useIsMutating and useMutationState tests for reactive getter-produced mutationKey, and removed three earlier duplicate “getter passed…” tests.

Changes

Cohort / File(s) Summary
Test File
packages/vue-query/src/__tests__/mutationOptions.test.ts
Reordered tests and replaced three earlier duplicate “getter passed…” cases with three focused tests: a useMutation test asserting data with a getter-produced options object lacking mutationKey; a useIsMutating test asserting isMutating transitions when mutationKey is a ref; and a useMutationState test asserting pending-state with a reactive mutationKey.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through tests with nimble feet,

rearranged the cases, tidy and neat.
Getters and refs now frolic in line,
Timers advance — assertions shine. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: reordering getter tests and grouping them by feature with unified test descriptions.
Description check ✅ Passed The description fully follows the template with all required sections completed, including detailed changes, completed checklist items, and release impact assessment.
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/vue-query-mutationOptions-reorder-getter-tests

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 13, 2026

View your CI Pipeline Execution ↗ for commit 0d45400

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

☁️ Nx Cloud last updated this comment at 2026-04-13 04:54:58 UTC

@sukvvon sukvvon self-assigned this Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

🚀 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 13, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 0d45400

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

size-limit report 📦

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

@sukvvon sukvvon force-pushed the test/vue-query-mutationOptions-reorder-getter-tests branch from 98a5ba0 to 0d45400 Compare April 13, 2026 04:52
@sukvvon sukvvon changed the title test(vue-query/mutationOptions): reorder getter tests to group by feature test(vue-query/mutationOptions): reorder getter tests to group by feature and unify test descriptions Apr 13, 2026
@sukvvon sukvvon merged commit 8826b43 into main Apr 13, 2026
8 checks passed
@sukvvon sukvvon deleted the test/vue-query-mutationOptions-reorder-getter-tests branch April 13, 2026 04:57
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