* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { waitFor } from '@testing-library/react';
import * as React from 'react';
import { useContext } from 'react';
import { mockAppState } from '../../../../helpers/testMocks';
expect(byText('null').get()).toBeInTheDocument();
- triggerNewStatus(newStatus);
-
- expect(
- await byText('{"status":{"hasFailures":false,"isCompleted":true}}').find(),
- ).toBeInTheDocument();
+ await waitFor(() => {
+ triggerNewStatus(newStatus);
+ });
+ expect(byText('{"status":{"hasFailures":false,"isCompleted":true}}').get()).toBeInTheDocument();
});
function renderIndexationContextProvider(props?: IndexationContextProviderProps) {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { act } from '@testing-library/react';
import * as React from 'react';
import { mockCurrentUser, mockLoggedInUser } from '../../../../helpers/testMocks';
import { renderComponent } from '../../../../helpers/testReactTestingUtils';
expect(IndexationNotificationHelper.markCompletedNotificationAsDisplayed).toHaveBeenCalled();
- jest.runAllTimers();
+ act(() => jest.runOnlyPendingTimers());
expect(IndexationNotificationHelper.markCompletedNotificationAsDisplayed).toHaveBeenCalled();