mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-10-20 04:34:11 +00:00
Use screen terminology instead of page as documented by vite-browser-react
This commit is contained in:
@@ -14,15 +14,15 @@ describe('<NotFound />', () => {
|
||||
it('passes a11y checks', () => checkAccessibility(setUp()));
|
||||
|
||||
it('shows expected error title', async () => {
|
||||
const page = await setUp();
|
||||
await expect.element(page.getByText('Oops! We could not find requested route.')).toBeInTheDocument();
|
||||
const screen = await setUp();
|
||||
await expect.element(screen.getByText('Oops! We could not find requested route.')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows expected error message', async () => {
|
||||
const page = await setUp();
|
||||
const screen = await setUp();
|
||||
await expect
|
||||
.element(
|
||||
page.getByText(
|
||||
screen.getByText(
|
||||
"Use your browser's back button to navigate to the page you have previously come from, or just press this button.",
|
||||
),
|
||||
)
|
||||
@@ -34,8 +34,8 @@ describe('<NotFound />', () => {
|
||||
[{ to: '/foo/bar', children: 'Hello' }, '/foo/bar', 'Hello'],
|
||||
[{ to: '/baz-bar', children: <>Foo</> }, '/baz-bar', 'Foo'],
|
||||
])('shows expected link and text', async (props, expectedLink, expectedText) => {
|
||||
const page = await setUp(props);
|
||||
const link = page.getByRole('link');
|
||||
const screen = await setUp(props);
|
||||
const link = screen.getByRole('link');
|
||||
|
||||
await expect.element(link).toHaveAttribute('href', expectedLink);
|
||||
await expect.element(link).toHaveTextContent(expectedText);
|
||||
|
||||
Reference in New Issue
Block a user