File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
src/helpers/state-machine/form/mutations/__tests__ Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Import
2
+ import FormMutations from '../form-state.mutations' ;
3
+
4
+ describe ( 'FormMutations' , ( ) => {
5
+ [
6
+ 'updateData' ,
7
+ 'updateXHRData' ,
8
+ 'updateXHRProgress' ,
9
+ 'updateErrorXHRProgress' ,
10
+ 'updateArrayData' ,
11
+ 'updateErrorData' ,
12
+ 'updateTabIndex'
13
+ ] . forEach ( ( actionName ) => {
14
+ it ( `Should be able to execute ${ actionName } ` , ( ) => {
15
+ const fieldStates = FormMutations [ actionName ] ;
16
+ const expected = '{\"type\":\"xstate.assign\",\"assignment\":{}}' ;
17
+ expect ( JSON . stringify ( fieldStates ) ) . toBe ( expected ) ;
18
+ } ) ;
19
+ } ) ;
20
+ } ) ;
Original file line number Diff line number Diff line change
1
+ // Import
2
+ import StepperMutations from '../stepper-state.mutations' ;
3
+
4
+ describe ( 'StepperMutations' , ( ) => {
5
+ [
6
+ 'updateActiveStep'
7
+ ] . forEach ( ( actionName ) => {
8
+ it ( `Should be able to execute ${ actionName } ` , ( ) => {
9
+ const fieldStates = StepperMutations [ actionName ] ;
10
+ const expected = '{\"type\":\"xstate.assign\",\"assignment\":{}}' ;
11
+ expect ( JSON . stringify ( fieldStates ) ) . toBe ( expected ) ;
12
+ } ) ;
13
+ } ) ;
14
+ } ) ;
You can’t perform that action at this time.
0 commit comments