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

renovate/major-react-monorepo
Alex Gleason 2023-01-05 17:45:48 -06:00
rodzic 3fa9cbe211
commit 1e89efebae
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -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 });