@@ -376,7 +376,6 @@ describe("useConnectMutation", () => {
376
376
wrapper,
377
377
}
378
378
) ;
379
-
380
379
const movie = {
381
380
title : "TanStack Query Firebase" ,
382
381
genre : "invalidate_option_test" ,
@@ -391,9 +390,11 @@ describe("useConnectMutation", () => {
391
390
expect ( result . current . status ) . toBe ( "success" ) ;
392
391
} ) ;
393
392
394
- expect ( invalidateQueriesSpy ) . toHaveBeenCalledWith ( {
395
- queryKey : [ listMoviesRef ( ) . name , undefined ] ,
396
- } ) ;
393
+ expect ( invalidateQueriesSpy ) . toHaveBeenCalledWith (
394
+ expect . objectContaining ( {
395
+ queryKey : [ listMoviesRef ( ) . name , null ] ,
396
+ } )
397
+ ) ;
397
398
} ) ;
398
399
399
400
test ( "invalidates queries specified in the invalidate option for upsert mutations" , async ( ) => {
@@ -445,9 +446,11 @@ describe("useConnectMutation", () => {
445
446
expect ( upsertMutationResult . current . data ?. movie_upsert . id ) . toBe ( movieId ) ;
446
447
} ) ;
447
448
448
- expect ( invalidateQueriesSpy ) . toHaveBeenCalledWith ( {
449
- queryKey : [ listMoviesRef ( ) . name , undefined ] ,
450
- } ) ;
449
+ expect ( invalidateQueriesSpy ) . toHaveBeenCalledWith (
450
+ expect . objectContaining ( {
451
+ queryKey : [ listMoviesRef ( ) . name , null ] ,
452
+ } )
453
+ ) ;
451
454
} ) ;
452
455
453
456
test ( "invalidates queries specified in the invalidate option for delete mutations" , async ( ) => {
@@ -497,9 +500,11 @@ describe("useConnectMutation", () => {
497
500
expect ( deleteMutationResult . current . data ?. movie_delete ?. id ) . toBe ( movieId ) ;
498
501
} ) ;
499
502
500
- expect ( invalidateQueriesSpy ) . toHaveBeenCalledWith ( {
501
- queryKey : [ listMoviesRef ( ) . name , undefined ] ,
502
- } ) ;
503
+ expect ( invalidateQueriesSpy ) . toHaveBeenCalledWith (
504
+ expect . objectContaining ( {
505
+ queryKey : [ listMoviesRef ( ) . name , null ] ,
506
+ } )
507
+ ) ;
503
508
} ) ;
504
509
505
510
test ( "calls onSuccess callback after successful create mutation" , async ( ) => {
0 commit comments