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