Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish 6.5 #24556

Merged
merged 10 commits into from
Oct 26, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,36 @@
import React from 'react';
import DetailView from '../index';
import props from './props.json';
import { shallow } from 'enzyme';

import {
mountWithRouterAndStore,
mockMoment,
toJson
} from '../../../../../utils/testHelpers';
import { mockMoment } from '../../../../../utils/testHelpers';

describe('DetailView', () => {
let storeState;
beforeEach(() => {
// Avoid timezone issues
mockMoment();

storeState = {
location: { search: '' }
};
});

it('should render empty state', () => {
const wrapper = mountWithRouterAndStore(
<DetailView errorGroup={[]} urlParams={props.urlParams} location={{}} />,
storeState
const wrapper = shallow(
<DetailView
errorGroup={[]}
urlParams={props.urlParams}
location={{ state: '' }}
/>
);

expect(toJson(wrapper)).toMatchSnapshot();
expect(wrapper).toMatchSnapshot();
});

it('should render with data', () => {
const wrapper = mountWithRouterAndStore(
const wrapper = shallow(
<DetailView
errorGroup={props.errorGroup}
urlParams={props.urlParams}
location={{}}
/>,
storeState
location={{ state: '' }}
/>
);

expect(toJson(wrapper)).toMatchSnapshot();
expect(wrapper).toMatchSnapshot();
});
});
Loading