2020-08-29 10:19:15 +03:00
|
|
|
import { shallow, ShallowWrapper } from 'enzyme';
|
|
|
|
import { Mock } from 'ts-mockery';
|
2020-09-04 20:05:41 +03:00
|
|
|
import { RouteComponentProps } from 'react-router';
|
2020-08-29 10:19:15 +03:00
|
|
|
import createScrollToTop from '../../src/common/ScrollToTop';
|
|
|
|
|
|
|
|
describe('<ScrollToTop />', () => {
|
|
|
|
let wrapper: ShallowWrapper;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
const ScrollToTop = createScrollToTop();
|
|
|
|
|
2020-09-04 20:05:41 +03:00
|
|
|
wrapper = shallow(<ScrollToTop {...Mock.all<RouteComponentProps>()}>Foobar</ScrollToTop>);
|
2020-08-29 10:19:15 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => wrapper.unmount());
|
|
|
|
|
|
|
|
it('just renders children', () => expect(wrapper.text()).toEqual('Foobar'));
|
|
|
|
});
|