@@ -276,7 +276,7 @@ describe(MethodRow.name, () => {
276276
277277 const addButton = screen . queryByLabelText ( "Add new model" ) ;
278278 expect ( addButton ) . toBeInTheDocument ( ) ;
279- expect ( addButton ) . toBeDisabled ( ) ;
279+ expect ( addButton ?. getElementsByTagName ( "input" ) [ 0 ] ) . toBeDisabled ( ) ;
280280
281281 expect ( screen . queryByLabelText ( "Remove model" ) ) . not . toBeInTheDocument ( ) ;
282282 } ) ;
@@ -292,7 +292,7 @@ describe(MethodRow.name, () => {
292292
293293 const addButton = screen . queryByLabelText ( "Add new model" ) ;
294294 expect ( addButton ) . toBeInTheDocument ( ) ;
295- expect ( addButton ) . toBeDisabled ( ) ;
295+ expect ( addButton ?. getElementsByTagName ( "input" ) [ 0 ] ) . toBeDisabled ( ) ;
296296
297297 expect ( screen . queryByLabelText ( "Remove model" ) ) . not . toBeInTheDocument ( ) ;
298298 } ) ;
@@ -308,7 +308,7 @@ describe(MethodRow.name, () => {
308308
309309 const addButton = screen . queryByLabelText ( "Add new model" ) ;
310310 expect ( addButton ) . toBeInTheDocument ( ) ;
311- expect ( addButton ) . toBeEnabled ( ) ;
311+ expect ( addButton ?. getElementsByTagName ( "input" ) [ 0 ] ) . toBeEnabled ( ) ;
312312
313313 expect ( screen . queryByLabelText ( "Remove model" ) ) . not . toBeInTheDocument ( ) ;
314314 } ) ;
@@ -327,11 +327,11 @@ describe(MethodRow.name, () => {
327327
328328 const addButton = screen . queryByLabelText ( "Add new model" ) ;
329329 expect ( addButton ) . toBeInTheDocument ( ) ;
330- expect ( addButton ) . toBeEnabled ( ) ;
330+ expect ( addButton ?. getElementsByTagName ( "input" ) [ 0 ] ) . toBeEnabled ( ) ;
331331
332332 const removeButton = screen . queryByLabelText ( "Remove model" ) ;
333333 expect ( removeButton ) . toBeInTheDocument ( ) ;
334- expect ( removeButton ) . toBeEnabled ( ) ;
334+ expect ( removeButton ?. getElementsByTagName ( "input" ) [ 0 ] ) . toBeEnabled ( ) ;
335335 } ) ;
336336
337337 it ( "shows add model button on last row and remove model button on all other rows" , async ( ) => {
@@ -350,12 +350,12 @@ describe(MethodRow.name, () => {
350350
351351 const addButtons = screen . queryAllByLabelText ( "Add new model" ) ;
352352 expect ( addButtons . length ) . toBe ( 1 ) ;
353- expect ( addButtons [ 0 ] ) . toBeEnabled ( ) ;
353+ expect ( addButtons [ 0 ] ?. getElementsByTagName ( "input" ) [ 0 ] ) . toBeEnabled ( ) ;
354354
355355 const removeButtons = screen . queryAllByLabelText ( "Remove model" ) ;
356356 expect ( removeButtons . length ) . toBe ( 3 ) ;
357357 for ( const removeButton of removeButtons ) {
358- expect ( removeButton ) . toBeEnabled ( ) ;
358+ expect ( removeButton ?. getElementsByTagName ( "input" ) [ 0 ] ) . toBeEnabled ( ) ;
359359 }
360360 } ) ;
361361} ) ;
0 commit comments