@@ -8,23 +8,22 @@ describe("BatchFx effect", () => {
88 expect ( dispatch ) . not . toBeCalled ( )
99 } )
1010 it ( "should dispatch single fx" , ( ) => {
11- const props = { }
1211 const effect = jest . fn ( )
13- const batchFx = BatchFx ( { props, effect } )
12+ const fx = { key : "value" , effect }
13+ const batchFx = BatchFx ( fx )
1414 const { dispatch } = runFx ( batchFx )
15- expect ( effect ) . toBeCalledWith ( props , dispatch )
15+ expect ( effect ) . toBeCalledWith ( fx , dispatch )
1616 } )
1717 it ( "should dispatch multiple fx" , ( ) => {
1818 const props1 = { first : "props" }
1919 const effect1 = jest . fn ( )
2020 const props2 = { second : "props" }
2121 const effect2 = jest . fn ( )
22- const batchFx = BatchFx (
23- { props : props1 , effect : effect1 } ,
24- { props : props2 , effect : effect2 }
25- )
22+ const fx1 = { props : props1 , effect : effect1 }
23+ const fx2 = { props : props2 , effect : effect2 }
24+ const batchFx = BatchFx ( fx1 , fx2 )
2625 const { dispatch } = runFx ( batchFx )
27- expect ( effect1 ) . toBeCalledWith ( props1 , dispatch )
28- expect ( effect2 ) . toBeCalledWith ( props2 , dispatch )
26+ expect ( effect1 ) . toBeCalledWith ( fx1 , dispatch )
27+ expect ( effect2 ) . toBeCalledWith ( fx2 , dispatch )
2928 } )
3029} )
0 commit comments