Skip to content

Commit

Permalink
fixup! Test(web-react): Use Jest's automock functionality to share us…
Browse files Browse the repository at this point in the history
…eIcon mock between tests
  • Loading branch information
literat committed Dec 19, 2024
1 parent ccdde6b commit 81873fb
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/react';
import React from 'react';
import {
useIconMock,
classNamePrefixProviderTest,
actionButtonColorPropsTest,
emotionColorPropsTest,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { render } from '@testing-library/react';
import React from 'react';
import { useIconMock } from '@local/tests';
import { SpiritFileUploaderAttachmentProps } from '../../../types';
import FileUploader from '../FileUploader';
import FileUploaderList from '../FileUploaderList';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { fireEvent, render, screen } from '@testing-library/react';
import React from 'react';
import { useIconMock } from '@local/tests';
import UncontrolledPagination from '../UncontrolledPagination';

jest.mock('../../../hooks/useIcon');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import '@testing-library/jest-dom';
import { render } from '@testing-library/react';
import React from 'react';
import {
useIconMock,
classNamePrefixProviderTest,
validationStatePropsTest,
requiredPropsTest,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import '@testing-library/jest-dom';
import { render } from '@testing-library/react';
import React from 'react';
import {
useIconMock,
classNamePrefixProviderTest,
textColorPropsTest,
restPropsTest,
stylePropsTest,
} from '@local/tests';
import { classNamePrefixProviderTest, textColorPropsTest, restPropsTest, stylePropsTest } from '@local/tests';
import Spinner from '../Spinner';

jest.mock('../../../hooks/useIcon');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import '@testing-library/jest-dom';
import { render } from '@testing-library/react';
import React from 'react';
import { useIconMock } from '@local/tests';
import { ToastLinkProps } from '../../../types';
import { ToastContext } from '../ToastContext';
import UncontrolledToast from '../UncontrolledToast';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/react';
import React from 'react';
import {
useIconMock,
classNamePrefixProviderTest,
sizeExtendedPropsTest,
restPropsTest,
stylePropsTest,
} from '@local/tests';
import { classNamePrefixProviderTest, sizeExtendedPropsTest, restPropsTest, stylePropsTest } from '@local/tests';
import { Icon } from '../../Icon';
import UNSTABLE_Avatar from '../UNSTABLE_Avatar';

Expand Down

0 comments on commit 81873fb

Please sign in to comment.