1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 11:28:51 +01:00
metamask-extension/ui/helpers/higher-order-components/with-modal-props/with-modal-props.test.js
Thomas Huang 4c3c4eebac
Final conversion of tests from enzyme to @testing-library/react (#16862)
* Add transaction activity log component

* Remove duplicate tx activity log snapshot.

* Convert Advanced Tab to tlr.

* Lint fix

* Change ENS to DNS in mock state data.

* Add test ids for speedup, cancel, rety buttons.

* Convert TransactionListItemDetails component to RTL.

* Convert PageContainerHeader component to RTL.

* Convert TokenInput component to RTL.

* Convert UnitInput component to RTL.

* Convert withModalProps to RTL.

* Convert i18n-helper to RTL.

* Convert ConfirmSeedPhrase component to TLR.

* Convert AddRecipient component to RTL.

* Set process.env metamask build type to 'main' for test

Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
2023-01-17 07:51:35 -08:00

32 lines
826 B
JavaScript

import configureMockStore from 'redux-mock-store';
import React from 'react';
import { renderWithProvider } from '../../../../test/lib/render-helpers';
import withModalProps from './with-modal-props';
const mockState = {
appState: {
modal: {
modalState: {
props: {
prop1: 'prop1',
prop2: 2,
prop3: true,
},
},
},
},
};
describe('withModalProps', () => {
it('should return a component wrapped with modal state props', () => {
const TestComponent = () => <div className="test">Testing</div>;
const WrappedComponent = withModalProps(TestComponent);
const store = configureMockStore()(mockState);
const { container } = renderWithProvider(
<WrappedComponent store={store} />,
);
expect(container).toMatchSnapshot();
});
});