mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-06-01 01:56:20 +00:00
Moved common test set-up code to helper function
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { screen } from '@testing-library/react';
|
||||
import { QrCodeFormat } from '../../../../src/utils/helpers/qrCodes';
|
||||
import { QrFormatDropdown } from '../../../../src/short-urls/helpers/qr-codes/QrFormatDropdown';
|
||||
import { renderWithEvents } from '../../../__mocks__/setUpTest';
|
||||
|
||||
describe('<QrFormatDropdown />', () => {
|
||||
const initialFormat: QrCodeFormat = 'svg';
|
||||
const setFormat = jest.fn();
|
||||
const setUp = () => ({
|
||||
user: userEvent.setup(),
|
||||
...render(<QrFormatDropdown format={initialFormat} setFormat={setFormat} />),
|
||||
});
|
||||
const setUp = () => renderWithEvents(<QrFormatDropdown format={initialFormat} setFormat={setFormat} />);
|
||||
|
||||
afterEach(jest.clearAllMocks);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user