2017-10-25 02:17:26 +00:00
|
|
|
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';
|
2018-01-22 12:24:05 +00:00
|
|
|
import { createMockRouteComponentProps } from '../utils/mockRouteComponentProps';
|
|
|
|
import { RouteComponentProps } from 'react-router';
|
2017-10-25 02:17:26 +00:00
|
|
|
|
|
|
|
Enzyme.configure({ adapter: new Adapter() });
|
|
|
|
|
2018-01-22 12:24:05 +00:00
|
|
|
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);
|
2017-10-25 02:17:26 +00:00
|
|
|
|
2018-01-22 12:24:05 +00:00
|
|
|
expect(component).toMatchSnapshot();
|
|
|
|
});
|
2017-10-25 02:17:26 +00:00
|
|
|
});
|