kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Tests: wrap toast.remove() with act()
rodzic
3fa9cbe211
commit
1e89efebae
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
import { act } from '@testing-library/react';
|
||||||
import { toast } from 'react-hot-toast';
|
import { toast } from 'react-hot-toast';
|
||||||
|
|
||||||
import { __clear as clearApiMocks } from '../api/__mocks__';
|
import { __clear as clearApiMocks } from '../api/__mocks__';
|
||||||
|
@ -17,7 +18,9 @@ require('fake-indexeddb/auto');
|
||||||
|
|
||||||
// Clear toasts after each test.
|
// Clear toasts after each test.
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
toast.remove();
|
act(() => {
|
||||||
|
toast.remove();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const intersectionObserverMock = () => ({ observe: () => null, disconnect: () => null });
|
const intersectionObserverMock = () => ({ observe: () => null, disconnect: () => null });
|
||||||
|
|
Ładowanie…
Reference in New Issue