sforkowany z mirror/soapbox
Tests: wrap toast.remove() with act()
rodzic
3fa9cbe211
commit
1e89efebae
|
@ -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,8 +18,10 @@ require('fake-indexeddb/auto');
|
|||
|
||||
// Clear toasts after each test.
|
||||
afterEach(() => {
|
||||
act(() => {
|
||||
toast.remove();
|
||||
});
|
||||
});
|
||||
|
||||
const intersectionObserverMock = () => ({ observe: () => null, disconnect: () => null });
|
||||
window.IntersectionObserver = jest.fn().mockImplementation(intersectionObserverMock);
|
||||
|
|
Ładowanie…
Reference in New Issue