mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-24 01:48:18 +03:00
21 lines
571 B
TypeScript
21 lines
571 B
TypeScript
import { shallow, ShallowWrapper } from 'enzyme';
|
|
import createScrollToTop from '../../src/common/ScrollToTop';
|
|
|
|
jest.mock('react-router-dom', () => ({
|
|
...jest.requireActual('react-router-dom'),
|
|
useLocation: jest.fn().mockReturnValue({}),
|
|
}));
|
|
|
|
describe('<ScrollToTop />', () => {
|
|
let wrapper: ShallowWrapper;
|
|
|
|
beforeEach(() => {
|
|
const ScrollToTop = createScrollToTop();
|
|
|
|
wrapper = shallow(<ScrollToTop>Foobar</ScrollToTop>);
|
|
});
|
|
|
|
afterEach(() => wrapper.unmount());
|
|
|
|
it('just renders children', () => expect(wrapper.text()).toEqual('Foobar'));
|
|
});
|