Tests: wrap toast.remove() with act()

This commit is contained in:
Alex Gleason
2023-01-05 17:45:48 -06:00
parent 3fa9cbe211
commit 1e89efebae

View File

@ -1,5 +1,6 @@
'use strict';
import { act } from '@testing-library/react';
import { toast } from 'react-hot-toast';
import { __clear as clearApiMocks } from '../api/__mocks__';
@ -17,7 +18,9 @@ require('fake-indexeddb/auto');
// Clear toasts after each test.
afterEach(() => {
toast.remove();
act(() => {
toast.remove();
});
});
const intersectionObserverMock = () => ({ observe: () => null, disconnect: () => null });