test(vue-query/useMutationState): split 'useMutationState' tests into separate file from 'useIsMutating.test.ts'#10236
Conversation
… separate file from 'useIsMutating.test.ts'
|
📝 WalkthroughWalkthroughThe changes reorganize test coverage for Vue Query's mutation hooks by removing useMutationState tests from the useIsMutating test file and establishing a dedicated test file for useMutationState with comprehensive behavioral scenarios. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit eeb3b57
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/vue-query/src/__tests__/useMutationState.test.ts (1)
19-54: Consider more descriptive test names.The test names "mutate 1" and "mutate 2" don't convey what scenario each test covers. Consider renaming to better describe the differences:
- Test 1 uses
filtersandselectoptions- Test 2 uses no options (default behavior)
✏️ Suggested naming improvement
- it('should return variables after calling mutate 1', () => { + it('should return variables with filters and select option', () => {- it('should return variables after calling mutate 2', () => { + it('should return variables with default options', () => {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/vue-query/src/__tests__/useMutationState.test.ts` around lines 19 - 54, The test names are not descriptive; rename the two it() descriptions to reflect their scenarios: change "should return variables after calling mutate 1" to something like "should return variables when using filters and select options" (covers useMutation with mutationKey/variables, then useMutationState with filters and select) and change "should return variables after calling mutate 2" to something like "should return variables by default when no options provided" (covers clearing the queryClient, useMutation, mutate, then useMutationState() with default behavior); update only the it() string literals surrounding the tests that call useMutation, mutate, and useMutationState so they clearly describe the differences.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/vue-query/src/__tests__/useMutationState.test.ts`:
- Around line 19-54: The test names are not descriptive; rename the two it()
descriptions to reflect their scenarios: change "should return variables after
calling mutate 1" to something like "should return variables when using filters
and select options" (covers useMutation with mutationKey/variables, then
useMutationState with filters and select) and change "should return variables
after calling mutate 2" to something like "should return variables by default
when no options provided" (covers clearing the queryClient, useMutation, mutate,
then useMutationState() with default behavior); update only the it() string
literals surrounding the tests that call useMutation, mutate, and
useMutationState so they clearly describe the differences.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a48a01fd-262d-49d9-a977-a9ae7a18c6b7
📒 Files selected for processing (2)
packages/vue-query/src/__tests__/useIsMutating.test.tspackages/vue-query/src/__tests__/useMutationState.test.ts
🎯 Changes
useMutationStatetests fromuseIsMutating.test.tsinto a dedicateduseMutationState.test.tsfile, aligning with the test file structure used in other packages (react-query, preact-query, solid-query, svelte-query).✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit