mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-10 19:16:10 +00:00
aabcd3f7a3
* Set default unit to 'ETH' instead of 'ether' * Use 'isEtherUnit()' everywhere * Set default unit to empty string * Update isEthUnit to isNetworkUnit * Fix unit conversion for non-ethereum networks * Set default network unit properly * Fix tests * fix typos * Update isNetworkUnit selector * Update isNetworkUnit * Fix validationhelpers tests * Add mock state to tests & Move isNetworkUnit to selectors * Fix validation helper spec * fix unit swap spec
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { configuredStore } from 'store';
|
|
import React from 'react';
|
|
import Enzyme from 'enzyme';
|
|
import Adapter from 'enzyme-adapter-react-16';
|
|
import ENS from 'containers/Tabs/ENS';
|
|
import shallowWithStore from '../utils/shallowWithStore';
|
|
import { createMockStore } from 'redux-test-utils';
|
|
import { createMockRouteComponentProps } from '../utils/mockRouteComponentProps';
|
|
import { RouteComponentProps } from 'react-router';
|
|
configuredStore.getState();
|
|
|
|
Enzyme.configure({ adapter: new Adapter() });
|
|
|
|
const routeProps: RouteComponentProps<any> = createMockRouteComponentProps({
|
|
match: { path: '/ens', url: '/ens', isExact: false, params: {} },
|
|
location: { pathname: '/ens', search: '', hash: '', key: 'e08jz7' },
|
|
history: {
|
|
length: 2,
|
|
action: 'PUSH',
|
|
location: { pathname: '/ens', search: '', hash: '', key: 'e08jz7', state: {} }
|
|
}
|
|
});
|
|
|
|
describe('snapshot test', () => {
|
|
it('ENS component', () => {
|
|
const testState = {};
|
|
const store = createMockStore(testState);
|
|
const component = shallowWithStore(<ENS {...routeProps} />, store);
|
|
|
|
expect(component).toMatchSnapshot();
|
|
});
|
|
});
|