mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-10-20 20:54:10 +00:00
Replace @testing-library/jest-dom with built-in vitest browser assertions
This commit is contained in:
@@ -13,29 +13,31 @@ describe('<NotFound />', () => {
|
||||
|
||||
it('passes a11y checks', () => checkAccessibility(setUp()));
|
||||
|
||||
it('shows expected error title', () => {
|
||||
it('shows expected error title', async () => {
|
||||
setUp();
|
||||
expect(screen.getByText('Oops! We could not find requested route.')).toBeInTheDocument();
|
||||
await expect.element(screen.getByText('Oops! We could not find requested route.')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows expected error message', () => {
|
||||
it('shows expected error message', async () => {
|
||||
setUp();
|
||||
expect(
|
||||
screen.getByText(
|
||||
"Use your browser's back button to navigate to the page you have previously come from, or just press this button.",
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
await expect
|
||||
.element(
|
||||
screen.getByText(
|
||||
"Use your browser's back button to navigate to the page you have previously come from, or just press this button.",
|
||||
),
|
||||
)
|
||||
.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it.each([
|
||||
[{}, '/', 'Home'],
|
||||
[{ to: '/foo/bar', children: 'Hello' }, '/foo/bar', 'Hello'],
|
||||
[{ to: '/baz-bar', children: <>Foo</> }, '/baz-bar', 'Foo'],
|
||||
])('shows expected link and text', (props, expectedLink, expectedText) => {
|
||||
])('shows expected link and text', async (props, expectedLink, expectedText) => {
|
||||
setUp(props);
|
||||
const link = screen.getByRole('link');
|
||||
|
||||
expect(link).toHaveAttribute('href', expectedLink);
|
||||
expect(link).toHaveTextContent(expectedText);
|
||||
await expect.element(link).toHaveAttribute('href', expectedLink);
|
||||
await expect.element(link).toHaveTextContent(expectedText);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user