1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Fix failing transaction-list-item.component test by mocking useLayoutEffect (#12118)

This commit is contained in:
Alex Donesky 2021-09-15 14:00:56 -05:00 committed by GitHub
parent f472c2615a
commit cf569161fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,6 +63,14 @@ setBackgroundConnection({
getGasFeeEstimatesAndStartPolling: jest.fn(),
});
jest.mock('react', () => {
const originReact = jest.requireActual('react');
return {
...originReact,
useLayoutEffect: jest.fn(),
};
});
const generateUseSelectorRouter = (opts) => (selector) => {
if (selector === getConversionRate) {
return 1;