mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-10-17 03:04:08 +00:00
Replace direct rendering with react testing library by vitest-browser-react
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { fireEvent, waitFor } from '@testing-library/react';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { Router } from 'react-router';
|
||||
@@ -97,7 +97,7 @@ describe('<CreateServer />', () => {
|
||||
|
||||
fireEvent.submit(page.getByTestId('server-form').element());
|
||||
|
||||
await waitFor(() => expect(page.getByRole('dialog')).toBeInTheDocument());
|
||||
await expect.element(page.getByRole('dialog')).toBeInTheDocument();
|
||||
await user.click(page.getByRole('button', { name: 'Discard' }));
|
||||
|
||||
expect(history.location.pathname).toEqual('/foo'); // Goes back to first route from history's initialEntries
|
||||
|
||||
Reference in New Issue
Block a user