mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-24 01:48:18 +03:00
20 lines
584 B
TypeScript
20 lines
584 B
TypeScript
|
import React from 'react';
|
||
|
import { shallow, ShallowWrapper } from 'enzyme';
|
||
|
import { Mock } from 'ts-mockery';
|
||
|
import { RouteChildrenProps } from 'react-router';
|
||
|
import createScrollToTop from '../../src/common/ScrollToTop';
|
||
|
|
||
|
describe('<ScrollToTop />', () => {
|
||
|
let wrapper: ShallowWrapper;
|
||
|
|
||
|
beforeEach(() => {
|
||
|
const ScrollToTop = createScrollToTop();
|
||
|
|
||
|
wrapper = shallow(<ScrollToTop {...Mock.all<RouteChildrenProps>()}>Foobar</ScrollToTop>);
|
||
|
});
|
||
|
|
||
|
afterEach(() => wrapper.unmount());
|
||
|
|
||
|
it('just renders children', () => expect(wrapper.text()).toEqual('Foobar'));
|
||
|
});
|