shlink-web-client/test/common/ScrollToTop.test.tsx
2023-05-27 11:57:26 +02:00

14 lines
458 B
TypeScript

import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router';
import { ScrollToTop } from '../../src/common/ScrollToTop';
describe('<ScrollToTop />', () => {
it.each([
['Foobar'],
['Barfoo'],
['Something'],
])('just renders children', (children) => {
render(<MemoryRouter><ScrollToTop>{children}</ScrollToTop></MemoryRouter>);
expect(screen.getByText(children)).toBeInTheDocument();
});
});