mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-07-23 20:21:53 +00:00
Moved common test set-up code to helper function
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { CopyToClipboardIcon } from '../../src/utils/CopyToClipboardIcon';
|
||||
import { renderWithEvents } from '../__mocks__/setUpTest';
|
||||
|
||||
describe('<CopyToClipboardIcon />', () => {
|
||||
const onCopy = jest.fn();
|
||||
const setUp = (text = 'foo') => ({
|
||||
user: userEvent.setup(),
|
||||
...render(<CopyToClipboardIcon text={text} onCopy={onCopy} />),
|
||||
});
|
||||
const setUp = (text = 'foo') => renderWithEvents(<CopyToClipboardIcon text={text} onCopy={onCopy} />);
|
||||
|
||||
afterEach(jest.clearAllMocks);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user