@@ -98,7 +98,7 @@ const renderForm = (props, options = {}) =>
9898 render (
9999 < DForm
100100 form = { form }
101- initialSectionIndex = { 0 }
101+ sectionIndex = { options . initialSectionIndex || 0 }
102102 answers = { [ ] }
103103 formikValues = { { } }
104104 formikTouched = { { } }
@@ -199,7 +199,7 @@ const renderForm = (props, options = {}) =>
199199 )
200200
201201test ( 'renders form section' , async ( ) => {
202- renderForm ( { initialSectionIndex : 1 } )
202+ renderForm ( null , { initialSectionIndex : 1 } )
203203 expect ( screen . queryByTestId ( 'field-1' ) ) . toHaveTextContent ( 'I am a text field' )
204204 expect ( screen . queryByTestId ( 'field-2' ) ) . toHaveTextContent (
205205 'I am a number field'
@@ -216,7 +216,7 @@ test('renders form section', async () => {
216216} )
217217
218218test ( 'move between sections and validate' , async ( ) => {
219- renderForm ( { initialSectionIndex : 0 } )
219+ renderForm ( )
220220 expect ( screen . queryByTestId ( 'field-8' ) ) . toHaveTextContent ( 'I am a text field' )
221221 expect ( screen . queryByTestId ( 'section-1' ) ) . toHaveTextContent ( 'IS VALID' )
222222 userEvent . click ( screen . queryByTestId ( 'move-to-next-section' ) )
@@ -240,7 +240,7 @@ test('move between sections and validate', async () => {
240240} )
241241
242242test ( 'values persitance when moving through sections' , async ( ) => {
243- renderForm ( { initialSectionIndex : 0 } )
243+ renderForm ( ) ;
244244 userEvent . type ( screen . queryByTestId ( 'field-input-8' ) , 'Some text answer 8' )
245245 userEvent . click ( screen . queryByTestId ( 'move-to-next-section' ) )
246246 userEvent . type ( screen . queryByTestId ( 'field-input-1' ) , 'Some text answer 1' )
@@ -262,7 +262,6 @@ test('form submit value map to answers', async () => {
262262 const onSubmit = jest . fn ( )
263263 renderForm (
264264 {
265- initialSectionIndex : 0 ,
266265 onSubmit,
267266 } ,
268267 {
0 commit comments