This repository was archived by the owner on Nov 11, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -738,7 +738,7 @@ describe("useGet hook", () => {
738738 nock ( "https://my-awesome-api.fake" )
739739 . get ( "/" )
740740 . reply ( 200 , { id : 2 } ) ;
741- children . mock . calls [ 1 ] [ 0 ] . refetch ( ) ;
741+ expect ( await children . mock . calls [ 1 ] [ 0 ] . refetch ( ) ) . toEqual ( { id : 2 } ) ;
742742 await wait ( ( ) => expect ( children ) . toHaveBeenCalledTimes ( 4 ) ) ;
743743
744744 // transition state
@@ -822,7 +822,7 @@ describe("useGet hook", () => {
822822 nock ( "https://my-awesome-api.fake" )
823823 . get ( "/plop" )
824824 . reply ( 200 , { id : 2 } ) ;
825- children . mock . calls [ 1 ] [ 0 ] . refetch ( { path : "/plop" } ) ;
825+ expect ( await children . mock . calls [ 1 ] [ 0 ] . refetch ( { path : "/plop" } ) ) . toEqual ( { id : 2 } ) ;
826826 await wait ( ( ) => expect ( children ) . toHaveBeenCalledTimes ( 4 ) ) ;
827827
828828 // transition state
@@ -1543,7 +1543,7 @@ describe("useGet hook", () => {
15431543 wrapper,
15441544 } ,
15451545 ) ;
1546- await result . current . refetch ( { pathParams : { id : "one" } } ) ;
1546+ expect ( await result . current . refetch ( { pathParams : { id : "one" } } ) ) . toEqual ( { id : 1 } ) ;
15471547
15481548 await wait ( ( ) =>
15491549 expect ( result . current ) . toMatchObject ( {
@@ -1572,7 +1572,7 @@ describe("useGet hook", () => {
15721572 wrapper,
15731573 } ,
15741574 ) ;
1575- await result . current . refetch ( { pathParams : { id : "one" } } ) ;
1575+ expect ( await result . current . refetch ( { pathParams : { id : "one" } } ) ) . toEqual ( { id : 1 } ) ;
15761576
15771577 expect ( result . current ) . toMatchObject ( {
15781578 error : null ,
You can’t perform that action at this time.
0 commit comments