diff --git a/__tests__/atomWithMutationState_spec.tsx b/__tests__/atomWithMutationState_spec.tsx index 5dc2f23..04aaae5 100644 --- a/__tests__/atomWithMutationState_spec.tsx +++ b/__tests__/atomWithMutationState_spec.tsx @@ -33,7 +33,12 @@ it('atomWithMutationState multiple', async () => { () => client ) - const mutationStateAtom = atomWithMutationState( + const pendingMutationStateAtom = atomWithMutationState( + () => ({ filters: { mutationKey: ['test-atom'], status: 'pending' } }), + () => client + ) + + const allMutationStatesAtom = atomWithMutationState( () => ({ filters: { mutationKey: ['test-atom'] } }), () => client ) @@ -41,11 +46,13 @@ it('atomWithMutationState multiple', async () => { function App() { const [{ mutate: mutate1 }] = useAtom(mutateAtom1) const [{ mutate: mutate2 }] = useAtom(mutateAtom2) - const [mutations] = useAtom(mutationStateAtom) + const [pendingMutationState] = useAtom(pendingMutationStateAtom) + const [allMutationStates] = useAtom(allMutationStatesAtom) return (
mutationCount: {mutations.length}
+all: {allMutationStates.length}
+pending: {pendingMutationState.length}