@@ -186,11 +186,13 @@ describe('<Wizard />', () => {
186186 expect ( onSubmit ) . toHaveBeenCalled ( ) ;
187187 } ) ;
188188
189- it ( 'should go to next step correctly and submit data' , ( ) => {
189+ it ( 'should go to next step correctly and submit data and formOptions ' , ( ) => {
190190 const onSubmit = jest . fn ( ) ;
191+ const formOptions = { ...initialProps . formOptions , onSubmit, getRegisteredFields : getRegisteredFieldsSchemaMock } ;
192+
191193 const wrapper = mount ( < Wizard
192194 { ...initialProps }
193- formOptions = { { ... initialProps . formOptions , onSubmit , getRegisteredFields : getRegisteredFieldsSchemaMock } }
195+ formOptions = { formOptions }
194196 fields = { schema }
195197 /> ) ;
196198 nextButtonClickWithHeader ( wrapper ) ;
@@ -203,7 +205,7 @@ describe('<Wizard />', () => {
203205 expect ( onSubmit ) . toHaveBeenCalledWith ( {
204206 'foo-field' : 'foo-field-value' ,
205207 'bar-field' : 'bar-field-value' ,
206- } ) ;
208+ } , formOptions ) ;
207209 } ) ;
208210
209211 it ( 'should pass values to cancel button' , ( ) => {
@@ -234,9 +236,16 @@ describe('<Wizard />', () => {
234236
235237 it ( 'should submit data when nested schema' , ( ) => {
236238 const onSubmit = jest . fn ( ) ;
239+ const formOptions = {
240+ ...initialProps . formOptions ,
241+ onSubmit,
242+ getRegisteredFields : getRegisteredFieldsNestedSchemaMock ,
243+ getState : getValuesNestedSchema ,
244+ } ;
245+
237246 const wrapper = mount ( < Wizard
238247 { ...initialProps }
239- formOptions = { { ... initialProps . formOptions , onSubmit , getRegisteredFields : getRegisteredFieldsNestedSchemaMock , getState : getValuesNestedSchema } }
248+ formOptions = { formOptions }
240249 fields = { nestedSchema }
241250 /> ) ;
242251
@@ -250,7 +259,7 @@ describe('<Wizard />', () => {
250259 'bar-field' : 'bar-field-value' ,
251260 } ,
252261 } ,
253- } ) ;
262+ } , formOptions ) ;
254263 } ) ;
255264
256265 it ( 'should build simple navigation' , ( ) => {
0 commit comments