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