mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-10-21 21:24:12 +00:00
Replace direct rendering with react testing library by vitest-browser-react
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { MemoryRouter } from 'react-router';
|
||||
import { ScrollToTop } from '../../src/common/ScrollToTop';
|
||||
import { checkAccessibility } from '../__helpers__/accessibility';
|
||||
import { render } from '../__helpers__/setUpTest.tsx';
|
||||
|
||||
describe('<ScrollToTop />', () => {
|
||||
const setUp = (children = 'Foo') =>
|
||||
@@ -14,7 +14,7 @@ describe('<ScrollToTop />', () => {
|
||||
it('passes a11y checks', () => checkAccessibility(setUp()));
|
||||
|
||||
it.each([['Foobar'], ['Barfoo'], ['Something']])('just renders children', async (children) => {
|
||||
setUp(children);
|
||||
const screen = await setUp(children);
|
||||
await expect.element(screen.getByText(children)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user