File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
packages/vue-query/src/__tests__ Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,25 @@ describe('mutationOptions', () => {
3535 expect ( mutationOptions ( object ) ) . toStrictEqual ( object )
3636 } )
3737
38+ it ( 'should return the getter received as a parameter without any modification (with mutationKey in mutationOptions)' , ( ) => {
39+ const getter = ( ) =>
40+ ( {
41+ mutationKey : [ 'key' ] ,
42+ mutationFn : ( ) => sleep ( 10 ) . then ( ( ) => 5 ) ,
43+ } ) as const
44+
45+ expect ( mutationOptions ( getter ) ) . toBe ( getter )
46+ } )
47+
48+ it ( 'should return the getter received as a parameter without any modification (without mutationKey in mutationOptions)' , ( ) => {
49+ const getter = ( ) =>
50+ ( {
51+ mutationFn : ( ) => sleep ( 10 ) . then ( ( ) => 5 ) ,
52+ } ) as const
53+
54+ expect ( mutationOptions ( getter ) ) . toBe ( getter )
55+ } )
56+
3857 it ( 'should return the number of fetching mutations when used with useIsMutating (with mutationKey in mutationOptions)' , async ( ) => {
3958 const isMutatingArray : Array < number > = [ ]
4059 const mutationOpts = mutationOptions ( {
You can’t perform that action at this time.
0 commit comments