We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33679a1 commit 5dd9d9aCopy full SHA for 5dd9d9a
1 file changed
packages/query-core/src/__tests__/queryClient.test.tsx
@@ -2114,5 +2114,21 @@ describe('queryClient', () => {
2114
mutationOptions2,
2115
)
2116
})
2117
+
2118
+ test('should return only matching defaults when multiple mutation defaults are set', () => {
2119
+ const key1 = queryKey()
2120
+ const key2 = queryKey()
2121
+ const mutationOptions1 = { retry: 1 }
2122
+ const mutationOptions2 = { retry: 2 }
2123
+ queryClient.setMutationDefaults(key1, mutationOptions1)
2124
+ queryClient.setMutationDefaults(key2, mutationOptions2)
2125
2126
+ expect(queryClient.getMutationDefaults(key1)).toMatchObject(
2127
+ mutationOptions1,
2128
+ )
2129
+ expect(queryClient.getMutationDefaults(key2)).toMatchObject(
2130
+ mutationOptions2,
2131
2132
+ })
2133
2134
0 commit comments