2022-05-06 20:13:51 +02:00
|
|
|
import { render, screen } from '@testing-library/react';
|
2023-05-27 11:57:26 +02:00
|
|
|
import { MemoryRouter } from 'react-router';
|
2022-05-06 20:13:51 +02:00
|
|
|
import { ScrollToTop } from '../../src/common/ScrollToTop';
|
2022-02-07 22:17:57 +01:00
|
|
|
|
2020-08-29 09:19:15 +02:00
|
|
|
describe('<ScrollToTop />', () => {
|
2022-05-06 20:13:51 +02:00
|
|
|
it.each([
|
|
|
|
['Foobar'],
|
|
|
|
['Barfoo'],
|
|
|
|
['Something'],
|
|
|
|
])('just renders children', (children) => {
|
|
|
|
render(<MemoryRouter><ScrollToTop>{children}</ScrollToTop></MemoryRouter>);
|
|
|
|
expect(screen.getByText(children)).toBeInTheDocument();
|
2020-08-29 09:19:15 +02:00
|
|
|
});
|
|
|
|
});
|