@@ -90,8 +90,7 @@ describe('DiscussionsHome', () => {
9090
9191 test ( 'full view should hide close button' , async ( ) => {
9292 renderComponent ( `/${ courseId } /topics` ) ;
93- expect ( screen . queryByText ( navigationBarMessages . allTopics . defaultMessage ) )
94- . toBeInTheDocument ( ) ;
93+ await screen . findByText ( navigationBarMessages . allTopics . defaultMessage ) ;
9594 expect ( screen . queryByRole ( 'button' , { name : 'Close' } ) )
9695 . not
9796 . toBeInTheDocument ( ) ;
@@ -206,9 +205,7 @@ describe('DiscussionsHome', () => {
206205 await executeThunk ( fetchCourseConfig ( courseId ) , store . dispatch , store . getState ) ;
207206 await renderComponent ( `/${ courseId } /learners` ) ;
208207
209- waitFor ( ( ) => {
210- expect ( screen . queryByText ( 'Nothing here yet' ) ) . toBeInTheDocument ( ) ;
211- } ) ;
208+ await screen . findByText ( 'Nothing here yet' ) ;
212209 } ) ;
213210
214211 it ( 'should display post editor form when click on add a post button for posts' , async ( ) => {
@@ -263,7 +260,7 @@ describe('DiscussionsHome', () => {
263260 it ( 'should display navigation tabs' , async ( ) => {
264261 renderComponent ( `/${ courseId } /topics` ) ;
265262
266- await waitFor ( ( ) => expect ( screen . queryByText ( 'Discussion' ) ) . toBeInTheDocument ( ) ) ;
263+ await screen . findByText ( 'Discussion' ) ;
267264 } ) ;
268265
269266 it ( 'should display content unavailable message when the user is not enrolled in the course.' , async ( ) => {
@@ -272,7 +269,7 @@ describe('DiscussionsHome', () => {
272269
273270 renderComponent ( ) ;
274271
275- await waitFor ( ( ) => expect ( screen . queryByText ( 'Content unavailable' ) ) . toBeInTheDocument ( ) ) ;
272+ await screen . findByText ( 'Content unavailable' ) ;
276273 } ) ;
277274
278275 it ( 'should redirect to dashboard when the user clicks on the Enroll button.' , async ( ) => {
0 commit comments