@@ -377,9 +377,7 @@ describe('<List />', () => {
377377 } ) ;
378378 it ( 'should be displayed if an item is selected' , async ( ) => {
379379 render ( < Default /> ) ;
380- await waitFor ( ( ) => {
381- expect ( screen . queryAllByRole ( 'checkbox' ) ) . toHaveLength ( 11 ) ;
382- } ) ;
380+ await screen . findByText ( 'War and Peace' ) ;
383381 fireEvent . click ( screen . getAllByRole ( 'checkbox' ) [ 0 ] ) ;
384382 expect (
385383 await screen . findByRole ( 'button' , { name : 'Select all' } )
@@ -421,17 +419,15 @@ describe('<List />', () => {
421419 } ) ;
422420 it ( 'should not be displayed if all items are selected with the "Select all" button' , async ( ) => {
423421 render ( < Default /> ) ;
424- await waitFor ( ( ) => {
425- expect ( screen . queryAllByRole ( 'checkbox' ) ) . toHaveLength ( 11 ) ;
426- } ) ;
422+ await screen . findByText ( 'War and Peace' ) ;
427423 fireEvent . click ( screen . getAllByRole ( 'checkbox' ) [ 0 ] ) ;
428424 await screen . findByText ( '10 items selected' ) ;
429425 fireEvent . click ( screen . getByRole ( 'button' , { name : 'Select all' } ) ) ;
430426 await screen . findByText ( '13 items selected' ) ;
431427 expect (
432428 screen . queryByRole ( 'button' , { name : 'Select all' } )
433429 ) . toBeNull ( ) ;
434- } ) ;
430+ } , 10000 ) ;
435431 it ( 'should not be displayed if the user reaches the limit by a manual selection' , async ( ) => {
436432 render (
437433 < SelectAllLimit
@@ -464,9 +460,7 @@ describe('<List />', () => {
464460 } ) }
465461 />
466462 ) ;
467- await waitFor ( ( ) => {
468- expect ( screen . queryAllByRole ( 'checkbox' ) ) . toHaveLength ( 4 ) ;
469- } ) ;
463+ await screen . findByText ( 'War and Peace' ) ;
470464 fireEvent . click ( screen . getAllByRole ( 'checkbox' ) [ 1 ] ) ;
471465 fireEvent . click ( screen . getAllByRole ( 'checkbox' ) [ 2 ] ) ;
472466 await screen . findByText ( '2 items selected' ) ;
@@ -476,9 +470,7 @@ describe('<List />', () => {
476470 } ) ;
477471 it ( 'should not be displayed if the user reaches the selectAllLimit by a click on the "Select all" button' , async ( ) => {
478472 render ( < SelectAllLimit /> ) ;
479- await waitFor ( ( ) => {
480- expect ( screen . queryAllByRole ( 'checkbox' ) ) . toHaveLength ( 11 ) ;
481- } ) ;
473+ await screen . findByText ( 'War and Peace' ) ;
482474 fireEvent . click ( screen . getAllByRole ( 'checkbox' ) [ 0 ] ) ;
483475 await screen . findByText ( '10 items selected' ) ;
484476 fireEvent . click ( screen . getByRole ( 'button' , { name : 'Select all' } ) ) ;
@@ -489,30 +481,26 @@ describe('<List />', () => {
489481 expect (
490482 screen . queryByRole ( 'button' , { name : 'Select all' } )
491483 ) . toBeNull ( ) ;
492- } ) ;
484+ } , 10000 ) ;
493485 it ( 'should select all items' , async ( ) => {
494486 render ( < Default /> ) ;
495- await waitFor ( ( ) => {
496- expect ( screen . queryAllByRole ( 'checkbox' ) ) . toHaveLength ( 11 ) ;
497- } ) ;
487+ await screen . findByText ( 'War and Peace' ) ;
498488 fireEvent . click ( screen . getAllByRole ( 'checkbox' ) [ 0 ] ) ;
499489 await screen . findByText ( '10 items selected' ) ;
500490 fireEvent . click ( screen . getByRole ( 'button' , { name : 'Select all' } ) ) ;
501491 await screen . findByText ( '13 items selected' ) ;
502- } ) ;
492+ } , 10000 ) ;
503493 it ( 'should select the maximum items possible up to the selectAllLimit' , async ( ) => {
504494 render ( < SelectAllLimit /> ) ;
505- await waitFor ( ( ) => {
506- expect ( screen . queryAllByRole ( 'checkbox' ) ) . toHaveLength ( 11 ) ;
507- } ) ;
495+ await screen . findByText ( 'War and Peace' ) ;
508496 fireEvent . click ( screen . getAllByRole ( 'checkbox' ) [ 0 ] ) ;
509497 await screen . findByText ( '10 items selected' ) ;
510498 fireEvent . click ( screen . getByRole ( 'button' , { name : 'Select all' } ) ) ;
511499 await screen . findByText ( '11 items selected' ) ;
512500 await screen . findByText (
513501 'There are too many elements to select them all. Only the first 11 elements were selected.'
514502 ) ;
515- } ) ;
503+ } , 10000 ) ;
516504 } ) ;
517505 it ( 'should render the default offline component node when offline' , async ( ) => {
518506 const { rerender } = render ( < Offline isOnline = { false } /> ) ;
0 commit comments