@@ -5,7 +5,7 @@ import React from 'react';
55import { Factory } from 'rosie' ;
66import { camelCaseObject } from '@edx/frontend-platform' ;
77import {
8- render , screen , cleanup , initializeMockApp ,
8+ render , screen , cleanup , initializeMockApp , act ,
99} from '../../../setupTest' ;
1010import BulkEmailTool from '../BulkEmailTool' ;
1111import { CourseMetadataContext } from '../../page-container/PageContainer' ;
@@ -67,14 +67,16 @@ describe('BulkEmailTool', () => {
6767 const cohorts = { cohorts : [ ] } ;
6868 const courseInfo = Factory . build ( 'courseMetadata' ) ;
6969 const courseMetadata = buildCourseMetadata ( cohorts , courseInfo ) ;
70- renderBulkEmailTool ( courseMetadata ) ;
71- // verify all tab data expected is displayed within our component
72- expect ( await screen . findByText ( 'Course' ) ) . toBeTruthy ( ) ;
73- expect ( await screen . findByText ( 'Discussion' ) ) . toBeTruthy ( ) ;
74- expect ( await screen . findByText ( 'Wiki' ) ) . toBeTruthy ( ) ;
75- expect ( await screen . findByText ( 'Progress' ) ) . toBeTruthy ( ) ;
76- expect ( await screen . findByText ( 'Instructor' ) ) . toBeTruthy ( ) ;
77- expect ( await screen . findByText ( 'Dates' ) ) . toBeTruthy ( ) ;
70+ await act ( async ( ) => {
71+ renderBulkEmailTool ( courseMetadata ) ;
72+ // verify all tab data expected is displayed within our component
73+ expect ( screen . findByText ( 'Course' ) ) . toBeTruthy ( ) ;
74+ expect ( screen . findByText ( 'Discussion' ) ) . toBeTruthy ( ) ;
75+ expect ( screen . findByText ( 'Wiki' ) ) . toBeTruthy ( ) ;
76+ expect ( screen . findByText ( 'Progress' ) ) . toBeTruthy ( ) ;
77+ expect ( screen . findByText ( 'Instructor' ) ) . toBeTruthy ( ) ;
78+ expect ( screen . findByText ( 'Dates' ) ) . toBeTruthy ( ) ;
79+ } ) ;
7880 } ) ;
7981
8082 test ( 'BulkEmailTool renders error page on no staff user' , async ( ) => {
0 commit comments