mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-16 12:33:48 +00:00
Fix incorrect types between testing library and vitest
This commit is contained in:
@@ -13,8 +13,6 @@ describe('<CreateShortUrlResult />', () => {
|
||||
<CreateShortUrlResult resetCreateShortUrl={() => {}} creation={creation} />,
|
||||
);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it('renders an error when error is true', () => {
|
||||
setUp({ error: true, saved: false, saving: false });
|
||||
expect(screen.getByText('An error occurred while creating the URL :(')).toBeInTheDocument();
|
||||
|
||||
@@ -31,8 +31,6 @@ describe('<DeleteShortUrlModal />', () => {
|
||||
/>,
|
||||
);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it('shows generic error when non-threshold error occurs', () => {
|
||||
setUp({
|
||||
loading: false,
|
||||
|
||||
@@ -19,8 +19,6 @@ describe('<ExportShortUrlsBtn />', () => {
|
||||
</MemoryRouter>,
|
||||
);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it.each([
|
||||
[undefined, '0'],
|
||||
[1, '1'],
|
||||
|
||||
@@ -17,8 +17,6 @@ describe('<QrCodeModal />', () => {
|
||||
/>,
|
||||
);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it('shows an external link to the URL in the header', () => {
|
||||
setUp();
|
||||
const externalLink = screen.getByRole('heading').querySelector('a');
|
||||
|
||||
@@ -10,8 +10,6 @@ describe('<QrErrorCorrectionDropdown />', () => {
|
||||
<QrErrorCorrectionDropdown errorCorrection={initialErrorCorrection} setErrorCorrection={setErrorCorrection} />,
|
||||
);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it('renders initial state', async () => {
|
||||
const { user } = setUp();
|
||||
const btn = screen.getByRole('button');
|
||||
|
||||
@@ -8,8 +8,6 @@ describe('<QrFormatDropdown />', () => {
|
||||
const setFormat = vi.fn();
|
||||
const setUp = () => renderWithEvents(<QrFormatDropdown format={initialFormat} setFormat={setFormat} />);
|
||||
|
||||
afterEach(vi.clearAllMocks);
|
||||
|
||||
it('renders initial state', async () => {
|
||||
const { user } = setUp();
|
||||
const btn = screen.getByRole('button');
|
||||
|
||||
Reference in New Issue
Block a user