@@ -9,20 +9,20 @@ const noopRId = `${CONST.REGISTRY_ACTION_CREATOR_PREFIX}:noOp`;
99
1010describe ( 'Testing <Dispatcher />' , ( ) => {
1111 let registry ;
12- const onError = jest . fn ( ) ;
12+ const onError = vi . fn ( ) ;
1313 beforeEach ( ( ) => {
1414 registry = {
15- [ `${ CONST . REGISTRY_ACTION_CREATOR_PREFIX } :existingActionCreator:id` ] : jest . fn ( ) ,
16- [ `${ CONST . REGISTRY_ACTION_CREATOR_PREFIX } :actionCreator:id` ] : jest . fn ( ) ,
17- [ `${ CONST . REGISTRY_ACTION_CREATOR_PREFIX } :noOp` ] : jest . fn ( ) ,
18- [ `${ CONST . REGISTRY_ACTION_CREATOR_PREFIX } :another:actionCreator:id` ] : jest . fn ( ) ,
15+ [ `${ CONST . REGISTRY_ACTION_CREATOR_PREFIX } :existingActionCreator:id` ] : vi . fn ( ) ,
16+ [ `${ CONST . REGISTRY_ACTION_CREATOR_PREFIX } :actionCreator:id` ] : vi . fn ( ) ,
17+ [ `${ CONST . REGISTRY_ACTION_CREATOR_PREFIX } :noOp` ] : vi . fn ( ) ,
18+ [ `${ CONST . REGISTRY_ACTION_CREATOR_PREFIX } :another:actionCreator:id` ] : vi . fn ( ) ,
1919 } ;
2020
21- jest . resetAllMocks ( ) ;
21+ vi . resetAllMocks ( ) ;
2222 } ) ;
2323
2424 it ( 'should add onclick event handler to its children' , ( ) => {
25- const dispatchActionCreator = jest . fn ( ) ;
25+ const dispatchActionCreator = vi . fn ( ) ;
2626
2727 render (
2828 < mock . Provider registry = { registry } onError = { onError } >
@@ -38,7 +38,7 @@ describe('Testing <Dispatcher />', () => {
3838 render (
3939 < mock . Provider registry = { registry } >
4040 < mock . Provider . ErrorBoundary onError = { onError } >
41- < Dispatcher onClick = "unknnown:actionCreator:id" dispatchActionCreator = { jest . fn ( ) } >
41+ < Dispatcher onClick = "unknnown:actionCreator:id" dispatchActionCreator = { vi . fn ( ) } >
4242 < button type = "button" > Hello</ button >
4343 </ Dispatcher >
4444 </ mock . Provider . ErrorBoundary >
@@ -85,8 +85,8 @@ describe('Testing <Dispatcher />', () => {
8585 ) ;
8686
8787 it ( 'should not prevent event propagation by default' , ( ) => {
88- const dispatchActionCreator = jest . fn ( ) ;
89- const onClick = jest . fn ( ) ;
88+ const dispatchActionCreator = vi . fn ( ) ;
89+ const onClick = vi . fn ( ) ;
9090 render (
9191 < mock . Provider registry = { registry } >
9292 < div onClick = { onClick } >
@@ -105,8 +105,8 @@ describe('Testing <Dispatcher />', () => {
105105 } ) ;
106106
107107 it ( 'should prevent event propagation if stopPropagation is set' , ( ) => {
108- const dispatchActionCreator = jest . fn ( ) ;
109- const onClick = jest . fn ( ) ;
108+ const dispatchActionCreator = vi . fn ( ) ;
109+ const onClick = vi . fn ( ) ;
110110 render (
111111 < mock . Provider registry = { registry } >
112112 < div onClick = { onClick } >
@@ -126,7 +126,7 @@ describe('Testing <Dispatcher />', () => {
126126 } ) ;
127127
128128 it ( 'should preventDefault if props is set' , ( ) => {
129- const dispatchActionCreator = jest . fn ( ) ;
129+ const dispatchActionCreator = vi . fn ( ) ;
130130 render (
131131 < mock . Provider registry = { registry } >
132132 < Dispatcher dispatchActionCreator = { dispatchActionCreator } preventDefault onClick = "noOp" >
@@ -136,13 +136,13 @@ describe('Testing <Dispatcher />', () => {
136136 ) ;
137137 const el = screen . getByText ( 'foo' ) ;
138138 const event = createEvent . click ( el , { } ) ;
139- event . preventDefault = jest . fn ( ) ;
139+ event . preventDefault = vi . fn ( ) ;
140140 fireEvent ( el , event ) ;
141141 expect ( event . preventDefault ) . toHaveBeenCalled ( ) ;
142142 } ) ;
143143
144144 it ( 'should dispatch actionCreator with props as data' , ( ) => {
145- const dispatchActionCreator = jest . fn ( ) ;
145+ const dispatchActionCreator = vi . fn ( ) ;
146146 const props = {
147147 dispatchActionCreator,
148148 preventDefault : true ,
@@ -160,7 +160,7 @@ describe('Testing <Dispatcher />', () => {
160160 const el = screen . getByText ( 'foo' ) ;
161161
162162 const event = createEvent . click ( el , { } ) ;
163- event . preventDefault = jest . fn ( ) ;
163+ event . preventDefault = vi . fn ( ) ;
164164 expect ( event . type ) . toBe ( 'click' ) ;
165165
166166 fireEvent ( el , event ) ;
0 commit comments