Fix incorrect types between testing library and vitest

This commit is contained in:
Alejandro Celaya
2023-05-27 12:29:03 +02:00
parent 12a05b422d
commit d14aea708e
77 changed files with 69 additions and 206 deletions

View File

@@ -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();

View File

@@ -31,8 +31,6 @@ describe('<DeleteShortUrlModal />', () => {
/>,
);
afterEach(vi.clearAllMocks);
it('shows generic error when non-threshold error occurs', () => {
setUp({
loading: false,

View File

@@ -19,8 +19,6 @@ describe('<ExportShortUrlsBtn />', () => {
</MemoryRouter>,
);
afterEach(vi.clearAllMocks);
it.each([
[undefined, '0'],
[1, '1'],

View File

@@ -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');

View File

@@ -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');

View File

@@ -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');