File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed
Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -38,19 +38,22 @@ describe('useWizard', () => {
3838 expect ( result . current . stepCount ) . toBe ( 2 ) ;
3939 } ) ;
4040
41- test ( 'should set step count to one when using falsy step' , ( ) => {
42- const { result } = renderHook ( ( ) => useWizard ( ) , {
43- wrapper : ( { children } ) => (
44- < Wizard >
45- < p > step 1 { children } </ p >
46- < p > step 2 { children } </ p >
47- { false && < p > step 3 { children } </ p > }
48- </ Wizard >
49- ) ,
50- } ) ;
41+ test . each ( [ false , null , undefined ] ) (
42+ 'should set step count to two when using %s as step' ,
43+ ( value ) => {
44+ const { result } = renderHook ( ( ) => useWizard ( ) , {
45+ wrapper : ( { children } ) => (
46+ < Wizard >
47+ < p > step 1 { children } </ p >
48+ < p > step 2 { children } </ p >
49+ { value && < p > step 3 { children } </ p > }
50+ </ Wizard >
51+ ) ,
52+ } ) ;
5153
52- expect ( result . current . stepCount ) . toBe ( 2 ) ;
53- } ) ;
54+ expect ( result . current . stepCount ) . toBe ( 2 ) ;
55+ } ,
56+ ) ;
5457
5558 test ( 'should set active step to one' , ( ) => {
5659 const { result } = renderUseWizardHook ( 1 ) ;
You can’t perform that action at this time.
0 commit comments