diff --git a/packages/web-react/.eslintrc.js b/packages/web-react/.eslintrc.js index 0a9553d451..789381364c 100644 --- a/packages/web-react/.eslintrc.js +++ b/packages/web-react/.eslintrc.js @@ -16,6 +16,7 @@ module.exports = { settings: { 'import/resolver': { + typescript: {}, node: { extensions: ['.js', '.jsx', '.ts', '.tsx', '.md'], }, @@ -24,6 +25,20 @@ module.exports = { plugins: ['promise', 'react', '@typescript-eslint', 'prettier', 'react-refresh'], rules: { + // Turn off unresolved imports because Typescript is already handling this + // @see: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md#importno-unresolved + 'import/no-unresolved': 'off', + + 'import/extensions': [ + 'error', + 'ignorePackages', + { + js: 'never', + jsx: 'never', + ts: 'never', + tsx: 'never', + }, + ], // @see: https://github.com/ArnaudBarre/eslint-plugin-react-refresh 'react-refresh/only-export-components': 'warn', // @TODO: add to typescript config @@ -73,9 +88,14 @@ module.exports = { { groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], pathGroups: [ + // { + // pattern: '**', + // group: 'internal', + // }, { - pattern: '**', - group: 'internal', + pattern: '@local/**', + group: 'parent', + position: 'before', }, { pattern: '..', diff --git a/packages/web-react/jest.config.ts b/packages/web-react/jest.config.ts index 897f2f3bcf..ab563909dc 100644 --- a/packages/web-react/jest.config.ts +++ b/packages/web-react/jest.config.ts @@ -13,6 +13,13 @@ const config = { // Automatically clear mock calls, instances, contexts and results before every test. // https://jestjs.io/docs/configuration#clearmocks-boolean clearMocks: true, + + // A map from regular expressions to module names or to arrays of module names + // https://jestjs.io/docs/configuration#modulenamemapper-objectstring-string--arraystring + moduleNameMapper: { + '^@local/(.*)': '/$1', + '^@local/tests/(.*)': '/tests/$1', + }, }; export default config; diff --git a/packages/web-react/package.json b/packages/web-react/package.json index f801a6af7d..dac54288b6 100644 --- a/packages/web-react/package.json +++ b/packages/web-react/package.json @@ -58,6 +58,7 @@ "eslint": "8.57.1", "eslint-config-airbnb": "19.0.4", "eslint-config-prettier": "9.1.0", + "eslint-import-resolver-typescript": "^3.7.0", "eslint-plugin-import": "2.31.0", "eslint-plugin-jsx-a11y": "6.10.2", "eslint-plugin-prettier": "5.2.1", diff --git a/packages/web-react/src/components/Accordion/__tests__/Accordion.test.tsx b/packages/web-react/src/components/Accordion/__tests__/Accordion.test.tsx index d2b4a95b16..c677b23b31 100644 --- a/packages/web-react/src/components/Accordion/__tests__/Accordion.test.tsx +++ b/packages/web-react/src/components/Accordion/__tests__/Accordion.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Accordion from '../Accordion'; describe('Accordion', () => { diff --git a/packages/web-react/src/components/Accordion/__tests__/AccordionContent.test.tsx b/packages/web-react/src/components/Accordion/__tests__/AccordionContent.test.tsx index fa2f98ef81..84c503abdb 100644 --- a/packages/web-react/src/components/Accordion/__tests__/AccordionContent.test.tsx +++ b/packages/web-react/src/components/Accordion/__tests__/AccordionContent.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import AccordionContent from '../AccordionContent'; import AccordionItem from '../AccordionItem'; diff --git a/packages/web-react/src/components/Accordion/__tests__/AccordionHeader.test.tsx b/packages/web-react/src/components/Accordion/__tests__/AccordionHeader.test.tsx index cd07f8698e..23d6a623a1 100644 --- a/packages/web-react/src/components/Accordion/__tests__/AccordionHeader.test.tsx +++ b/packages/web-react/src/components/Accordion/__tests__/AccordionHeader.test.tsx @@ -1,14 +1,11 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import AccordionHeader from '../AccordionHeader'; import AccordionItem from '../AccordionItem'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('AccordionHeader', () => { classNamePrefixProviderTest(AccordionHeader, 'Accordion__itemHeader'); diff --git a/packages/web-react/src/components/Accordion/__tests__/AccordionItem.test.tsx b/packages/web-react/src/components/Accordion/__tests__/AccordionItem.test.tsx index 29ed0baee5..14941f3b20 100644 --- a/packages/web-react/src/components/Accordion/__tests__/AccordionItem.test.tsx +++ b/packages/web-react/src/components/Accordion/__tests__/AccordionItem.test.tsx @@ -1,16 +1,13 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Accordion from '../Accordion'; import AccordionContent from '../AccordionContent'; import AccordionHeader from '../AccordionHeader'; import AccordionItem from '../AccordionItem'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('AccordionItem', () => { classNamePrefixProviderTest(AccordionItem, 'Accordion__item'); diff --git a/packages/web-react/src/components/Accordion/__tests__/UncontrolledAccordion.test.tsx b/packages/web-react/src/components/Accordion/__tests__/UncontrolledAccordion.test.tsx index 63fdb27a50..1904ad306b 100644 --- a/packages/web-react/src/components/Accordion/__tests__/UncontrolledAccordion.test.tsx +++ b/packages/web-react/src/components/Accordion/__tests__/UncontrolledAccordion.test.tsx @@ -1,16 +1,13 @@ import '@testing-library/jest-dom'; import { fireEvent, render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import AccordionContent from '../AccordionContent'; import AccordionHeader from '../AccordionHeader'; import AccordionItem from '../AccordionItem'; import UncontrolledAccordion from '../UncontrolledAccordion'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('UncontrolledAccordion', () => { classNamePrefixProviderTest(UncontrolledAccordion, 'Accordion'); diff --git a/packages/web-react/src/components/Alert/__tests__/Alert.test.tsx b/packages/web-react/src/components/Alert/__tests__/Alert.test.tsx index 9051d37362..e94f11133c 100644 --- a/packages/web-react/src/components/Alert/__tests__/Alert.test.tsx +++ b/packages/web-react/src/components/Alert/__tests__/Alert.test.tsx @@ -1,14 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { emotionColorPropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, emotionColorPropsTest, restPropsTest, stylePropsTest } from '@local/tests'; import Alert from '../Alert'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('Alert', () => { classNamePrefixProviderTest(Alert, 'Alert'); diff --git a/packages/web-react/src/components/Breadcrumbs/__tests__/Breadcrumbs.test.tsx b/packages/web-react/src/components/Breadcrumbs/__tests__/Breadcrumbs.test.tsx index 2e387bd727..5582cfd853 100644 --- a/packages/web-react/src/components/Breadcrumbs/__tests__/Breadcrumbs.test.tsx +++ b/packages/web-react/src/components/Breadcrumbs/__tests__/Breadcrumbs.test.tsx @@ -1,13 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Breadcrumbs from '../Breadcrumbs'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('Breadcrumbs', () => { classNamePrefixProviderTest(Breadcrumbs, 'Breadcrumbs'); diff --git a/packages/web-react/src/components/Breadcrumbs/__tests__/BreadcrumbsItem.test.tsx b/packages/web-react/src/components/Breadcrumbs/__tests__/BreadcrumbsItem.test.tsx index 16eb17ec51..7854b644bd 100644 --- a/packages/web-react/src/components/Breadcrumbs/__tests__/BreadcrumbsItem.test.tsx +++ b/packages/web-react/src/components/Breadcrumbs/__tests__/BreadcrumbsItem.test.tsx @@ -1,13 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import BreadcrumbsItem from '../BreadcrumbsItem'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('BreadcrumbsItem', () => { classNamePrefixProviderTest(BreadcrumbsItem, 'd-none'); diff --git a/packages/web-react/src/components/Button/__tests__/Button.test.tsx b/packages/web-react/src/components/Button/__tests__/Button.test.tsx index 98a4e55a82..b2407b336f 100644 --- a/packages/web-react/src/components/Button/__tests__/Button.test.tsx +++ b/packages/web-react/src/components/Button/__tests__/Button.test.tsx @@ -1,19 +1,18 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; import { + classNamePrefixProviderTest, actionButtonColorPropsTest, emotionColorPropsTest, sizePropsTest, -} from '../../../../tests/providerTests/dictionaryPropsTest'; -import { loadingPropsTest } from '../../../../tests/providerTests/loadingPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; + loadingPropsTest, + restPropsTest, + stylePropsTest, +} from '@local/tests'; import Button from '../Button'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('Button', () => { classNamePrefixProviderTest(Button, 'Button'); diff --git a/packages/web-react/src/components/ButtonLink/__tests__/ButtonLink.test.tsx b/packages/web-react/src/components/ButtonLink/__tests__/ButtonLink.test.tsx index 012c6e3ccc..11a804fc7d 100644 --- a/packages/web-react/src/components/ButtonLink/__tests__/ButtonLink.test.tsx +++ b/packages/web-react/src/components/ButtonLink/__tests__/ButtonLink.test.tsx @@ -1,19 +1,18 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; import { + classNamePrefixProviderTest, actionButtonColorPropsTest, emotionColorPropsTest, sizePropsTest, -} from '../../../../tests/providerTests/dictionaryPropsTest'; -import { loadingPropsTest } from '../../../../tests/providerTests/loadingPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; + loadingPropsTest, + restPropsTest, + stylePropsTest, +} from '@local/tests'; import ButtonLink from '../ButtonLink'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('ButtonLink', () => { classNamePrefixProviderTest(ButtonLink, 'Button'); diff --git a/packages/web-react/src/components/Card/__tests__/Card.test.tsx b/packages/web-react/src/components/Card/__tests__/Card.test.tsx index 354dbc584e..0651910889 100644 --- a/packages/web-react/src/components/Card/__tests__/Card.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/Card.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Card from '../Card'; describe('Card', () => { @@ -20,7 +18,7 @@ describe('Card', () => { }); it('should render custom element', () => { - render(); + render(); expect(screen.getByTestId('test')).toContainHTML('section'); }); diff --git a/packages/web-react/src/components/Card/__tests__/CardArtwork.test.tsx b/packages/web-react/src/components/Card/__tests__/CardArtwork.test.tsx index c7917c638b..2da564fd31 100644 --- a/packages/web-react/src/components/Card/__tests__/CardArtwork.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardArtwork.test.tsx @@ -1,10 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { alignmentXPropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, alignmentXPropsTest, restPropsTest, stylePropsTest } from '@local/tests'; import CardArtwork from '../CardArtwork'; describe('CardArtwork', () => { @@ -17,13 +14,13 @@ describe('CardArtwork', () => { alignmentXPropsTest(CardArtwork, 'CardArtwork'); it('should render artwork card component and have default class name', () => { - render(); + render(); expect(screen.getByTestId('test')).toHaveClass('CardArtwork'); }); it('should render text children', () => { - render(Hello World); + render(Hello World); expect(screen.getByTestId('test')).toHaveTextContent('Hello World'); }); diff --git a/packages/web-react/src/components/Card/__tests__/CardBody.test.tsx b/packages/web-react/src/components/Card/__tests__/CardBody.test.tsx index 90b512df23..beb167644a 100644 --- a/packages/web-react/src/components/Card/__tests__/CardBody.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardBody.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import CardBody from '../CardBody'; describe('CardBody', () => { diff --git a/packages/web-react/src/components/Card/__tests__/CardEyebrow.test.tsx b/packages/web-react/src/components/Card/__tests__/CardEyebrow.test.tsx index 1fdf9d32a1..c01e70ad7d 100644 --- a/packages/web-react/src/components/Card/__tests__/CardEyebrow.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardEyebrow.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import CardEyebrow from '../CardEyebrow'; describe('CardEyebrow', () => { @@ -14,13 +12,13 @@ describe('CardEyebrow', () => { restPropsTest(CardEyebrow, '.CardEyebrow'); it('should render eyebrow card component and have default class name', () => { - render(); + render(); expect(screen.getByTestId('test')).toHaveClass('CardEyebrow'); }); it('should render text children', () => { - render(Hello World); + render(Hello World); expect(screen.getByTestId('test')).toHaveTextContent('Hello World'); }); diff --git a/packages/web-react/src/components/Card/__tests__/CardFooter.test.tsx b/packages/web-react/src/components/Card/__tests__/CardFooter.test.tsx index 9833c193e0..f05c56496a 100644 --- a/packages/web-react/src/components/Card/__tests__/CardFooter.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardFooter.test.tsx @@ -1,10 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { alignmentXPropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, alignmentXPropsTest, restPropsTest, stylePropsTest } from '@local/tests'; import CardFooter from '../CardFooter'; describe('CardFooter', () => { diff --git a/packages/web-react/src/components/Card/__tests__/CardLink.test.tsx b/packages/web-react/src/components/Card/__tests__/CardLink.test.tsx index e9afb8ac78..48be0def5a 100644 --- a/packages/web-react/src/components/Card/__tests__/CardLink.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardLink.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import CardLink from '../CardLink'; describe('CardLink', () => { diff --git a/packages/web-react/src/components/Card/__tests__/CardLogo.test.tsx b/packages/web-react/src/components/Card/__tests__/CardLogo.test.tsx index aa66f375d8..a6435977e0 100644 --- a/packages/web-react/src/components/Card/__tests__/CardLogo.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardLogo.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import CardLogo from '../CardLogo'; describe('CardLogo', () => { @@ -14,13 +12,13 @@ describe('CardLogo', () => { restPropsTest(CardLogo, '.CardLogo'); it('should render logo card component and have default class name', () => { - render(); + render(); expect(screen.getByTestId('test')).toHaveClass('CardLogo'); }); it('should render text children', () => { - render(Hello World); + render(Hello World); expect(screen.getByTestId('test')).toHaveTextContent('Hello World'); }); diff --git a/packages/web-react/src/components/Card/__tests__/CardMedia.test.tsx b/packages/web-react/src/components/Card/__tests__/CardMedia.test.tsx index a19c1189d6..da894fb101 100644 --- a/packages/web-react/src/components/Card/__tests__/CardMedia.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardMedia.test.tsx @@ -1,10 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { sizePropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, sizePropsTest, restPropsTest, stylePropsTest } from '@local/tests'; import CardMedia from '../CardMedia'; describe('CardMedia', () => { @@ -17,19 +14,19 @@ describe('CardMedia', () => { sizePropsTest(CardMedia); it('should render media card media component and have default class names', () => { - render(); + render(); expect(screen.getByTestId('test')).toHaveClass('CardMedia CardMedia--auto'); }); it('should render auto size', () => { - render(); + render(); expect(screen.getByTestId('test')).toHaveClass('CardMedia--auto'); }); it('should fill the height', () => { - render(); + render(); expect(screen.getByTestId('test')).toHaveClass('CardMedia--filledHeight'); }); diff --git a/packages/web-react/src/components/Card/__tests__/CardTitle.test.tsx b/packages/web-react/src/components/Card/__tests__/CardTitle.test.tsx index 8c2d84d575..ab76be71e6 100644 --- a/packages/web-react/src/components/Card/__tests__/CardTitle.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardTitle.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import CardTitle from '../CardTitle'; describe('CardTitle', () => { @@ -14,25 +12,25 @@ describe('CardTitle', () => { restPropsTest(CardTitle, '.CardTitle'); it('should render title card component and have default class names', () => { - render(); + render(); expect(screen.getByTestId('test')).toHaveClass('CardTitle CardTitle--heading'); }); it('should render custom element', () => { - render(); + render(); expect(screen.getByTestId('test')).toContainHTML('h1'); }); it('should render as heading', () => { - render(); + render(); expect(screen.getByTestId('test')).toHaveClass('CardTitle--heading'); }); it('should render text children', () => { - render(Hello World); + render(Hello World); expect(screen.getByTestId('test')).toHaveTextContent('Hello World'); }); diff --git a/packages/web-react/src/components/Checkbox/__tests__/Checkbox.test.tsx b/packages/web-react/src/components/Checkbox/__tests__/Checkbox.test.tsx index 689a232407..dfcd15c43a 100644 --- a/packages/web-react/src/components/Checkbox/__tests__/Checkbox.test.tsx +++ b/packages/web-react/src/components/Checkbox/__tests__/Checkbox.test.tsx @@ -1,13 +1,15 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { validationStatePropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { itemPropsTest } from '../../../../tests/providerTests/itemPropsTest'; -import { requiredPropsTest } from '../../../../tests/providerTests/requiredPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; -import { validationTextPropsTest } from '../../../../tests/providerTests/validationTextPropsTest'; +import { + classNamePrefixProviderTest, + validationStatePropsTest, + itemPropsTest, + requiredPropsTest, + restPropsTest, + stylePropsTest, + validationTextPropsTest, +} from '@local/tests'; import Checkbox from '../Checkbox'; describe('Checkbox', () => { diff --git a/packages/web-react/src/components/Collapse/__tests__/Collapse.test.tsx b/packages/web-react/src/components/Collapse/__tests__/Collapse.test.tsx index 5566f0d389..379d083728 100644 --- a/packages/web-react/src/components/Collapse/__tests__/Collapse.test.tsx +++ b/packages/web-react/src/components/Collapse/__tests__/Collapse.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { act, fireEvent, render, screen } from '@testing-library/react'; import React, { useState } from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import { Button } from '../../Button'; import Collapse from '../Collapse'; diff --git a/packages/web-react/src/components/Collapse/__tests__/UncontrolledCollapse.test.tsx b/packages/web-react/src/components/Collapse/__tests__/UncontrolledCollapse.test.tsx index 210f5f6c98..006e4a6e39 100644 --- a/packages/web-react/src/components/Collapse/__tests__/UncontrolledCollapse.test.tsx +++ b/packages/web-react/src/components/Collapse/__tests__/UncontrolledCollapse.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import { Button } from '../../Button'; import UncontrolledCollapse from '../UncontrolledCollapse'; diff --git a/packages/web-react/src/components/Container/__tests__/Container.test.tsx b/packages/web-react/src/components/Container/__tests__/Container.test.tsx index ce370e6850..c4302df3bc 100644 --- a/packages/web-react/src/components/Container/__tests__/Container.test.tsx +++ b/packages/web-react/src/components/Container/__tests__/Container.test.tsx @@ -1,9 +1,7 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import '@testing-library/jest-dom'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Container from '../Container'; describe('Container', () => { diff --git a/packages/web-react/src/components/Divider/__tests__/Divider.test.tsx b/packages/web-react/src/components/Divider/__tests__/Divider.test.tsx index 9de9e00f24..a444538066 100644 --- a/packages/web-react/src/components/Divider/__tests__/Divider.test.tsx +++ b/packages/web-react/src/components/Divider/__tests__/Divider.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Divider from '../Divider'; describe('Divider', () => { diff --git a/packages/web-react/src/components/Dropdown/__tests__/Dropdown.test.tsx b/packages/web-react/src/components/Dropdown/__tests__/Dropdown.test.tsx index 8712c22db1..829d0d6264 100644 --- a/packages/web-react/src/components/Dropdown/__tests__/Dropdown.test.tsx +++ b/packages/web-react/src/components/Dropdown/__tests__/Dropdown.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen, fireEvent } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Dropdown from '../Dropdown'; import DropdownPopover from '../DropdownPopover'; import DropdownTrigger from '../DropdownTrigger'; diff --git a/packages/web-react/src/components/Dropdown/__tests__/DropdownPopover.test.tsx b/packages/web-react/src/components/Dropdown/__tests__/DropdownPopover.test.tsx index 47dae94795..9e4ee91748 100644 --- a/packages/web-react/src/components/Dropdown/__tests__/DropdownPopover.test.tsx +++ b/packages/web-react/src/components/Dropdown/__tests__/DropdownPopover.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import DropdownPopover from '../DropdownPopover'; describe('DropdownPopover', () => { diff --git a/packages/web-react/src/components/Dropdown/__tests__/DropdownTrigger.test.tsx b/packages/web-react/src/components/Dropdown/__tests__/DropdownTrigger.test.tsx index 2e3ff42a65..ab4212cbbb 100644 --- a/packages/web-react/src/components/Dropdown/__tests__/DropdownTrigger.test.tsx +++ b/packages/web-react/src/components/Dropdown/__tests__/DropdownTrigger.test.tsx @@ -1,13 +1,11 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { restPropsTest, stylePropsTest } from '@local/tests'; import { Button } from '../../Button'; import DropdownTrigger from '../DropdownTrigger'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('DropdownTrigger', () => { stylePropsTest((props) => ); diff --git a/packages/web-react/src/components/FieldGroup/__tests__/FieldGroup.test.tsx b/packages/web-react/src/components/FieldGroup/__tests__/FieldGroup.test.tsx index 94658cf061..3ca128da89 100644 --- a/packages/web-react/src/components/FieldGroup/__tests__/FieldGroup.test.tsx +++ b/packages/web-react/src/components/FieldGroup/__tests__/FieldGroup.test.tsx @@ -1,11 +1,13 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { validationStatePropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; -import { validationTextPropsTest } from '../../../../tests/providerTests/validationTextPropsTest'; +import { + classNamePrefixProviderTest, + validationStatePropsTest, + restPropsTest, + stylePropsTest, + validationTextPropsTest, +} from '@local/tests'; import FieldGroup from '../FieldGroup'; describe('FieldGroup', () => { diff --git a/packages/web-react/src/components/FileUploader/__tests__/FileUploader.test.tsx b/packages/web-react/src/components/FileUploader/__tests__/FileUploader.test.tsx index 62eb5c2d25..c13b8fb104 100644 --- a/packages/web-react/src/components/FileUploader/__tests__/FileUploader.test.tsx +++ b/packages/web-react/src/components/FileUploader/__tests__/FileUploader.test.tsx @@ -1,12 +1,9 @@ import '@testing-library/jest-dom'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import FileUploader from '../FileUploader'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('FileUploader', () => { classNamePrefixProviderTest(FileUploader, 'FileUploader'); diff --git a/packages/web-react/src/components/FileUploader/__tests__/FileUploaderInput.test.tsx b/packages/web-react/src/components/FileUploader/__tests__/FileUploaderInput.test.tsx index 3c4c84df3f..2c65d28591 100644 --- a/packages/web-react/src/components/FileUploader/__tests__/FileUploaderInput.test.tsx +++ b/packages/web-react/src/components/FileUploader/__tests__/FileUploaderInput.test.tsx @@ -1,14 +1,11 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { renderToString } from 'react-dom/server'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { validationTextPropsTest } from '../../../../tests/providerTests/validationTextPropsTest'; +import { classNamePrefixProviderTest, restPropsTest, validationTextPropsTest } from '@local/tests'; import FileUploaderInput from '../FileUploaderInput'; import '@testing-library/jest-dom'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('FileUploaderInput', () => { classNamePrefixProviderTest(FileUploaderInput, 'FileUploaderInput'); diff --git a/packages/web-react/src/components/FileUploader/__tests__/FileUploaderList.test.tsx b/packages/web-react/src/components/FileUploader/__tests__/FileUploaderList.test.tsx index 832353d813..7a4123e95d 100644 --- a/packages/web-react/src/components/FileUploader/__tests__/FileUploaderList.test.tsx +++ b/packages/web-react/src/components/FileUploader/__tests__/FileUploaderList.test.tsx @@ -1,11 +1,10 @@ import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; import { SpiritFileUploaderAttachmentProps } from '../../../types'; import FileUploader from '../FileUploader'; import FileUploaderList from '../FileUploaderList'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('FileUploaderList', () => { const props = { diff --git a/packages/web-react/src/components/Flex/__tests__/Flex.test.tsx b/packages/web-react/src/components/Flex/__tests__/Flex.test.tsx index f33aeeaad8..69933980a8 100644 --- a/packages/web-react/src/components/Flex/__tests__/Flex.test.tsx +++ b/packages/web-react/src/components/Flex/__tests__/Flex.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Flex from '../Flex'; describe('Flex', () => { diff --git a/packages/web-react/src/components/Footer/__tests__/Footer.test.tsx b/packages/web-react/src/components/Footer/__tests__/Footer.test.tsx index bd391fc54d..b4cebd091b 100644 --- a/packages/web-react/src/components/Footer/__tests__/Footer.test.tsx +++ b/packages/web-react/src/components/Footer/__tests__/Footer.test.tsx @@ -1,8 +1,7 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import '@testing-library/jest-dom'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { restPropsTest, stylePropsTest } from '@local/tests'; import { BackgroundColors } from '../../../constants'; import Footer from '../Footer'; diff --git a/packages/web-react/src/components/Grid/__tests__/Grid.test.tsx b/packages/web-react/src/components/Grid/__tests__/Grid.test.tsx index 784e08bff0..c0f2a11727 100644 --- a/packages/web-react/src/components/Grid/__tests__/Grid.test.tsx +++ b/packages/web-react/src/components/Grid/__tests__/Grid.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Grid from '../Grid'; describe('Grid', () => { diff --git a/packages/web-react/src/components/Grid/__tests__/GridItem.test.tsx b/packages/web-react/src/components/Grid/__tests__/GridItem.test.tsx index 19591a0f4b..13a80a22a5 100644 --- a/packages/web-react/src/components/Grid/__tests__/GridItem.test.tsx +++ b/packages/web-react/src/components/Grid/__tests__/GridItem.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import GridItem from '../GridItem'; describe('Grid', () => { diff --git a/packages/web-react/src/components/Header/__tests__/Header.test.tsx b/packages/web-react/src/components/Header/__tests__/Header.test.tsx index f2095346e4..d043013964 100644 --- a/packages/web-react/src/components/Header/__tests__/Header.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/Header.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Header from '../Header'; describe('Header', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderButton.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderButton.test.tsx index da594762a7..07365d506c 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderButton.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderButton.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderButton from '../HeaderButton'; describe('HeaderButton', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderDesktopActions.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderDesktopActions.test.tsx index 4961d5fdc0..686f12a7bc 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderDesktopActions.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderDesktopActions.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderDesktopActions from '../HeaderDesktopActions'; describe('HeaderDesktopActions', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderDialog.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderDialog.test.tsx index a0036542b8..0ec5189fc7 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderDialog.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderDialog.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderDialog from '../HeaderDialog'; describe('HeaderDialog', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderDialogActions.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderDialogActions.test.tsx index e1708dfd97..567a86d1d6 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderDialogActions.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderDialogActions.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderDialogActions from '../HeaderDialogActions'; describe('HeaderDialogActions', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderDialogButton.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderDialogButton.test.tsx index 0866e38b4a..0820c3874c 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderDialogButton.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderDialogButton.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderDialogButton from '../HeaderDialogButton'; describe('HeaderDialogButton', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderDialogCloseButton.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderDialogCloseButton.test.tsx index 1680db3025..8581921ccf 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderDialogCloseButton.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderDialogCloseButton.test.tsx @@ -1,13 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderDialogCloseButton from '../HeaderDialogCloseButton'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('HeaderDialogCloseButton', () => { classNamePrefixProviderTest(HeaderDialogCloseButton, 'HeaderDialogCloseButton'); diff --git a/packages/web-react/src/components/Header/__tests__/HeaderDialogLink.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderDialogLink.test.tsx index b217c0b901..73d2919872 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderDialogLink.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderDialogLink.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderDialogLink from '../HeaderDialogLink'; describe('HeaderDialogLink', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderDialogNav.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderDialogNav.test.tsx index 9dec6b659d..6fe793d6c5 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderDialogNav.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderDialogNav.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderDialogNav from '../HeaderDialogNav'; describe('HeaderDialogNav', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderDialogNavItem.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderDialogNavItem.test.tsx index 3006fcc70c..978de4ece9 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderDialogNavItem.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderDialogNavItem.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderDialogNavItem from '../HeaderDialogNavItem'; describe('HeaderDialogNavItem', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderDialogText.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderDialogText.test.tsx index 80a0222448..85fb4a715d 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderDialogText.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderDialogText.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderDialogText from '../HeaderDialogText'; describe('HeaderDialogText', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderLink.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderLink.test.tsx index 627a7dcde6..0ab2b66b45 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderLink.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderLink.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderLink from '../HeaderLink'; describe('HeaderLink', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderMobileActions.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderMobileActions.test.tsx index 421fadb3bc..a2820c5b8c 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderMobileActions.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderMobileActions.test.tsx @@ -1,14 +1,11 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import { HEADER_MENU_TOGGLE_LABEL_DEFAULT } from '../constants'; import HeaderMobileActions from '../HeaderMobileActions'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('HeaderMobileActions', () => { classNamePrefixProviderTest(HeaderMobileActions, 'HeaderMobileActions'); diff --git a/packages/web-react/src/components/Header/__tests__/HeaderNav.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderNav.test.tsx index d66af497a2..ef556462d4 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderNav.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderNav.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderNav from '../HeaderNav'; describe('HeaderNav', () => { diff --git a/packages/web-react/src/components/Header/__tests__/HeaderNavItem.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderNavItem.test.tsx index 45958e8f8b..e52b1d2ba5 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderNavItem.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderNavItem.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderNavItem from '../HeaderNavItem'; describe('HeaderNavItem', () => { diff --git a/packages/web-react/src/components/Heading/__tests__/Heading.test.tsx b/packages/web-react/src/components/Heading/__tests__/Heading.test.tsx index bba2d52418..faeaaecec6 100644 --- a/packages/web-react/src/components/Heading/__tests__/Heading.test.tsx +++ b/packages/web-react/src/components/Heading/__tests__/Heading.test.tsx @@ -1,10 +1,13 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import '@testing-library/jest-dom'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { sizeExtendedPropsTest, sizePropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { + classNamePrefixProviderTest, + sizeExtendedPropsTest, + sizePropsTest, + restPropsTest, + stylePropsTest, +} from '@local/tests'; import { SizesDictionaryType, SizeExtendedDictionaryType, EmphasisDictionaryType } from '../../../types'; import Heading from '../Heading'; import headingSizeDataProvider from './headingSizeDataProvider'; diff --git a/packages/web-react/src/components/Icon/__tests__/Icon.test.tsx b/packages/web-react/src/components/Icon/__tests__/Icon.test.tsx index 98edf28295..a04078b6a2 100644 --- a/packages/web-react/src/components/Icon/__tests__/Icon.test.tsx +++ b/packages/web-react/src/components/Icon/__tests__/Icon.test.tsx @@ -1,12 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { restPropsTest, stylePropsTest } from '@local/tests'; import Icon from '../Icon'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('Icon', () => { const AddIcon = (props: Record) => ; diff --git a/packages/web-react/src/components/Item/__tests__/Item.test.tsx b/packages/web-react/src/components/Item/__tests__/Item.test.tsx index 0280ac5b49..a1d82534ca 100644 --- a/packages/web-react/src/components/Item/__tests__/Item.test.tsx +++ b/packages/web-react/src/components/Item/__tests__/Item.test.tsx @@ -1,13 +1,11 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { restPropsTest, stylePropsTest } from '@local/tests'; import { SpiritItemProps } from '../../../types'; import Item from '../Item'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('Item', () => { stylePropsTest(Item); diff --git a/packages/web-react/src/components/Link/__tests__/Link.test.tsx b/packages/web-react/src/components/Link/__tests__/Link.test.tsx index 031dca39e0..0bf31fd926 100644 --- a/packages/web-react/src/components/Link/__tests__/Link.test.tsx +++ b/packages/web-react/src/components/Link/__tests__/Link.test.tsx @@ -1,10 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { actionLinkColorPropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, actionLinkColorPropsTest, restPropsTest, stylePropsTest } from '@local/tests'; import { ActionLinkColorsDictionaryType } from '../../../types'; import Link from '../Link'; import linkPropsDataProvider from './linkPropsDataProvider'; diff --git a/packages/web-react/src/components/Modal/__tests__/Modal.test.tsx b/packages/web-react/src/components/Modal/__tests__/Modal.test.tsx index e3305c0e10..316edbd84e 100644 --- a/packages/web-react/src/components/Modal/__tests__/Modal.test.tsx +++ b/packages/web-react/src/components/Modal/__tests__/Modal.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import { SpiritModalProps } from '../../../types'; import Modal from '../Modal'; diff --git a/packages/web-react/src/components/Modal/__tests__/ModalBody.test.tsx b/packages/web-react/src/components/Modal/__tests__/ModalBody.test.tsx index 79244468da..c666ee0f6d 100644 --- a/packages/web-react/src/components/Modal/__tests__/ModalBody.test.tsx +++ b/packages/web-react/src/components/Modal/__tests__/ModalBody.test.tsx @@ -1,7 +1,5 @@ import '@testing-library/jest-dom'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ModalBody from '../ModalBody'; describe('ModalBody', () => { diff --git a/packages/web-react/src/components/Modal/__tests__/ModalCloseButton.test.tsx b/packages/web-react/src/components/Modal/__tests__/ModalCloseButton.test.tsx index 62483f3268..e88a5ca075 100644 --- a/packages/web-react/src/components/Modal/__tests__/ModalCloseButton.test.tsx +++ b/packages/web-react/src/components/Modal/__tests__/ModalCloseButton.test.tsx @@ -1,13 +1,10 @@ import '@testing-library/jest-dom'; import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ModalCloseButton from '../ModalCloseButton'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('ModalCloseButton', () => { classNamePrefixProviderTest(ModalCloseButton, 'Button'); diff --git a/packages/web-react/src/components/Modal/__tests__/ModalDialog.test.tsx b/packages/web-react/src/components/Modal/__tests__/ModalDialog.test.tsx index 456622573b..c1762f616a 100644 --- a/packages/web-react/src/components/Modal/__tests__/ModalDialog.test.tsx +++ b/packages/web-react/src/components/Modal/__tests__/ModalDialog.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ModalDialog from '../ModalDialog'; describe('ModalDialog', () => { diff --git a/packages/web-react/src/components/Modal/__tests__/ModalFooter.test.tsx b/packages/web-react/src/components/Modal/__tests__/ModalFooter.test.tsx index d4319aa0ac..23d2784cad 100644 --- a/packages/web-react/src/components/Modal/__tests__/ModalFooter.test.tsx +++ b/packages/web-react/src/components/Modal/__tests__/ModalFooter.test.tsx @@ -1,7 +1,5 @@ import '@testing-library/jest-dom'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ModalFooter from '../ModalFooter'; describe('ModalFooter', () => { diff --git a/packages/web-react/src/components/Modal/__tests__/ModalHeader.test.tsx b/packages/web-react/src/components/Modal/__tests__/ModalHeader.test.tsx index 9a6fe4cbf6..8ac1b31ac1 100644 --- a/packages/web-react/src/components/Modal/__tests__/ModalHeader.test.tsx +++ b/packages/web-react/src/components/Modal/__tests__/ModalHeader.test.tsx @@ -1,13 +1,10 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ModalHeader from '../ModalHeader'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('ModalHeader', () => { classNamePrefixProviderTest(ModalHeader, 'ModalHeader'); diff --git a/packages/web-react/src/components/Pagination/__tests__/Pagination.test.tsx b/packages/web-react/src/components/Pagination/__tests__/Pagination.test.tsx index 7ca2637797..50155eae18 100644 --- a/packages/web-react/src/components/Pagination/__tests__/Pagination.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/Pagination.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Pagination from '../Pagination'; describe('Pagination', () => { diff --git a/packages/web-react/src/components/Pagination/__tests__/PaginationButtonLink.test.tsx b/packages/web-react/src/components/Pagination/__tests__/PaginationButtonLink.test.tsx index 2e20764ffe..2bbe83f507 100644 --- a/packages/web-react/src/components/Pagination/__tests__/PaginationButtonLink.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/PaginationButtonLink.test.tsx @@ -1,11 +1,8 @@ import '@testing-library/jest-dom'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import PaginationButtonLink from '../PaginationButtonLink'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('PaginationButtonLink', () => { classNamePrefixProviderTest(PaginationButtonLink, 'Button'); diff --git a/packages/web-react/src/components/Pagination/__tests__/PaginationItem.test.tsx b/packages/web-react/src/components/Pagination/__tests__/PaginationItem.test.tsx index 5e6526dfd1..828bfe1c67 100644 --- a/packages/web-react/src/components/Pagination/__tests__/PaginationItem.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/PaginationItem.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import PaginationItem from '../PaginationItem'; describe('PaginationItem', () => { diff --git a/packages/web-react/src/components/Pagination/__tests__/PaginationLink.test.tsx b/packages/web-react/src/components/Pagination/__tests__/PaginationLink.test.tsx index 8c842a3ccd..68fe3029f2 100644 --- a/packages/web-react/src/components/Pagination/__tests__/PaginationLink.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/PaginationLink.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import PaginationLink from '../PaginationLink'; describe('PaginationLink', () => { diff --git a/packages/web-react/src/components/Pagination/__tests__/PaginationLinkNext.test.tsx b/packages/web-react/src/components/Pagination/__tests__/PaginationLinkNext.test.tsx index ed974d4990..90d3271ecb 100644 --- a/packages/web-react/src/components/Pagination/__tests__/PaginationLinkNext.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/PaginationLinkNext.test.tsx @@ -1,11 +1,8 @@ import '@testing-library/jest-dom'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import PaginationLinkNext from '../PaginationLinkNext'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('PaginationLinkNext', () => { classNamePrefixProviderTest(PaginationLinkNext, 'Button'); diff --git a/packages/web-react/src/components/Pagination/__tests__/PaginationLinkPrevious.test.tsx b/packages/web-react/src/components/Pagination/__tests__/PaginationLinkPrevious.test.tsx index 3abb54123e..7970c91598 100644 --- a/packages/web-react/src/components/Pagination/__tests__/PaginationLinkPrevious.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/PaginationLinkPrevious.test.tsx @@ -1,11 +1,8 @@ import '@testing-library/jest-dom'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import PaginationLinkPrevious from '../PaginationLinkPrevious'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('PaginationLinkPrevious', () => { classNamePrefixProviderTest(PaginationLinkPrevious, 'Button'); diff --git a/packages/web-react/src/components/Pagination/__tests__/UncontrolledPagination.test.tsx b/packages/web-react/src/components/Pagination/__tests__/UncontrolledPagination.test.tsx index b3cba2b5be..b29a3bd6f1 100644 --- a/packages/web-react/src/components/Pagination/__tests__/UncontrolledPagination.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/UncontrolledPagination.test.tsx @@ -1,9 +1,8 @@ import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; import UncontrolledPagination from '../UncontrolledPagination'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('UncontrolledPagination', () => { const onPageChange = jest.fn(); diff --git a/packages/web-react/src/components/PartnerLogo/__tests__/PartnerLogo.test.tsx b/packages/web-react/src/components/PartnerLogo/__tests__/PartnerLogo.test.tsx index 82236cc247..53cd757a7f 100644 --- a/packages/web-react/src/components/PartnerLogo/__tests__/PartnerLogo.test.tsx +++ b/packages/web-react/src/components/PartnerLogo/__tests__/PartnerLogo.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import { Sizes } from '../../../constants'; import PartnerLogo from '../PartnerLogo'; diff --git a/packages/web-react/src/components/Pill/__tests__/Pill.test.tsx b/packages/web-react/src/components/Pill/__tests__/Pill.test.tsx index 7c1f61cbcf..e742bfd92d 100644 --- a/packages/web-react/src/components/Pill/__tests__/Pill.test.tsx +++ b/packages/web-react/src/components/Pill/__tests__/Pill.test.tsx @@ -1,10 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { emotionColorPropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, emotionColorPropsTest, restPropsTest, stylePropsTest } from '@local/tests'; import Pill from '../Pill'; describe('Pill', () => { diff --git a/packages/web-react/src/components/ProductLogo/__tests__/ProductLogo.test.tsx b/packages/web-react/src/components/ProductLogo/__tests__/ProductLogo.test.tsx index 06bd3af976..861946830c 100644 --- a/packages/web-react/src/components/ProductLogo/__tests__/ProductLogo.test.tsx +++ b/packages/web-react/src/components/ProductLogo/__tests__/ProductLogo.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ProductLogo from '../ProductLogo'; describe('ProductLogo', () => { diff --git a/packages/web-react/src/components/Radio/__tests__/Radio.test.tsx b/packages/web-react/src/components/Radio/__tests__/Radio.test.tsx index 3eb1778e17..1dc92b3c1b 100644 --- a/packages/web-react/src/components/Radio/__tests__/Radio.test.tsx +++ b/packages/web-react/src/components/Radio/__tests__/Radio.test.tsx @@ -1,12 +1,14 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { validationStatePropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { itemPropsTest } from '../../../../tests/providerTests/itemPropsTest'; -import { requiredPropsTest } from '../../../../tests/providerTests/requiredPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { + classNamePrefixProviderTest, + validationStatePropsTest, + itemPropsTest, + requiredPropsTest, + restPropsTest, + stylePropsTest, +} from '@local/tests'; import Radio from '../Radio'; describe('Radio', () => { diff --git a/packages/web-react/src/components/ScrollView/__tests__/ScrollView.test.tsx b/packages/web-react/src/components/ScrollView/__tests__/ScrollView.test.tsx index e3a35a7b9c..e7e9582d10 100644 --- a/packages/web-react/src/components/ScrollView/__tests__/ScrollView.test.tsx +++ b/packages/web-react/src/components/ScrollView/__tests__/ScrollView.test.tsx @@ -1,8 +1,6 @@ import '@testing-library/jest-dom'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ScrollView from '../ScrollView'; describe('ScrollView', () => { diff --git a/packages/web-react/src/components/Select/__tests__/Select.test.tsx b/packages/web-react/src/components/Select/__tests__/Select.test.tsx index e9c3a030b9..6e530e125d 100644 --- a/packages/web-react/src/components/Select/__tests__/Select.test.tsx +++ b/packages/web-react/src/components/Select/__tests__/Select.test.tsx @@ -1,16 +1,17 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { validationStatePropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { requiredPropsTest } from '../../../../tests/providerTests/requiredPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; -import { validationTextPropsTest } from '../../../../tests/providerTests/validationTextPropsTest'; +import { + classNamePrefixProviderTest, + validationStatePropsTest, + requiredPropsTest, + restPropsTest, + stylePropsTest, + validationTextPropsTest, +} from '@local/tests'; import Select from '../Select'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('Select', () => { classNamePrefixProviderTest(Select, 'Select'); diff --git a/packages/web-react/src/components/Spinner/__tests__/Spinner.test.tsx b/packages/web-react/src/components/Spinner/__tests__/Spinner.test.tsx index f891cadc56..d17ac3f2e3 100644 --- a/packages/web-react/src/components/Spinner/__tests__/Spinner.test.tsx +++ b/packages/web-react/src/components/Spinner/__tests__/Spinner.test.tsx @@ -1,14 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { textColorPropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, textColorPropsTest, restPropsTest, stylePropsTest } from '@local/tests'; import Spinner from '../Spinner'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('Spinner', () => { classNamePrefixProviderTest(Spinner, 'animation-spin-clockwise'); diff --git a/packages/web-react/src/components/Stack/__tests__/Stack.test.tsx b/packages/web-react/src/components/Stack/__tests__/Stack.test.tsx index bdee4e1312..31aac39d3b 100644 --- a/packages/web-react/src/components/Stack/__tests__/Stack.test.tsx +++ b/packages/web-react/src/components/Stack/__tests__/Stack.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Stack from '../Stack'; describe('Stack', () => { diff --git a/packages/web-react/src/components/Tabs/__tests__/TabItem.test.tsx b/packages/web-react/src/components/Tabs/__tests__/TabItem.test.tsx index f290332ad8..2a055a3b8f 100644 --- a/packages/web-react/src/components/Tabs/__tests__/TabItem.test.tsx +++ b/packages/web-react/src/components/Tabs/__tests__/TabItem.test.tsx @@ -1,10 +1,7 @@ import '@testing-library/jest-dom'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; -import { withTabsContext } from '../../../../tests/testUtils/withTabsContext'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest, withTabsContext } from '@local/tests'; import TabItem from '../TabItem'; describe('TabItem', () => { diff --git a/packages/web-react/src/components/Tabs/__tests__/TabLink.test.tsx b/packages/web-react/src/components/Tabs/__tests__/TabLink.test.tsx index d471dd732f..8bb47b8323 100644 --- a/packages/web-react/src/components/Tabs/__tests__/TabLink.test.tsx +++ b/packages/web-react/src/components/Tabs/__tests__/TabLink.test.tsx @@ -1,8 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, stylePropsTest } from '@local/tests'; import TabLink from '../TabLink'; describe('TabLink', () => { diff --git a/packages/web-react/src/components/Tabs/__tests__/TabList.test.tsx b/packages/web-react/src/components/Tabs/__tests__/TabList.test.tsx index 3f554cfc4a..56370940f5 100644 --- a/packages/web-react/src/components/Tabs/__tests__/TabList.test.tsx +++ b/packages/web-react/src/components/Tabs/__tests__/TabList.test.tsx @@ -1,8 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, stylePropsTest } from '@local/tests'; import TabList from '../TabList'; import Tabs from '../Tabs'; diff --git a/packages/web-react/src/components/Tabs/__tests__/TabPane.test.tsx b/packages/web-react/src/components/Tabs/__tests__/TabPane.test.tsx index 780e34f02b..0f7e049e05 100644 --- a/packages/web-react/src/components/Tabs/__tests__/TabPane.test.tsx +++ b/packages/web-react/src/components/Tabs/__tests__/TabPane.test.tsx @@ -1,10 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; -import { withTabsContext } from '../../../../tests/testUtils/withTabsContext'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest, withTabsContext } from '@local/tests'; import TabContent from '../TabContent'; import { TabsContextType } from '../TabContext'; import TabPane from '../TabPane'; diff --git a/packages/web-react/src/components/Tag/__tests__/Tag.test.tsx b/packages/web-react/src/components/Tag/__tests__/Tag.test.tsx index c63a16fa34..814184df5a 100644 --- a/packages/web-react/src/components/Tag/__tests__/Tag.test.tsx +++ b/packages/web-react/src/components/Tag/__tests__/Tag.test.tsx @@ -1,10 +1,13 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { emotionColorPropsTest, sizeExtendedPropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { + classNamePrefixProviderTest, + emotionColorPropsTest, + sizeExtendedPropsTest, + restPropsTest, + stylePropsTest, +} from '@local/tests'; import Tag from '../Tag'; describe('Tag', () => { diff --git a/packages/web-react/src/components/Text/__tests__/Text.test.tsx b/packages/web-react/src/components/Text/__tests__/Text.test.tsx index ce836ccfaa..db4ebd2085 100644 --- a/packages/web-react/src/components/Text/__tests__/Text.test.tsx +++ b/packages/web-react/src/components/Text/__tests__/Text.test.tsx @@ -1,10 +1,13 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import '@testing-library/jest-dom'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { sizeExtendedPropsTest, sizePropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { + classNamePrefixProviderTest, + sizeExtendedPropsTest, + sizePropsTest, + restPropsTest, + stylePropsTest, +} from '@local/tests'; import { EmphasisDictionaryType, SizesDictionaryType, SizeExtendedDictionaryType } from '../../../types'; import Text from '../Text'; import textPropsDataProvider from './textPropsDataProvider'; diff --git a/packages/web-react/src/components/TextArea/__tests__/TextArea.test.tsx b/packages/web-react/src/components/TextArea/__tests__/TextArea.test.tsx index 52b11d3470..a334fba6b0 100644 --- a/packages/web-react/src/components/TextArea/__tests__/TextArea.test.tsx +++ b/packages/web-react/src/components/TextArea/__tests__/TextArea.test.tsx @@ -1,12 +1,14 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { validationStatePropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { requiredPropsTest } from '../../../../tests/providerTests/requiredPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; -import { validationTextPropsTest } from '../../../../tests/providerTests/validationTextPropsTest'; +import { + classNamePrefixProviderTest, + validationStatePropsTest, + requiredPropsTest, + restPropsTest, + stylePropsTest, + validationTextPropsTest, +} from '@local/tests'; import TextArea from '../TextArea'; describe('TextArea', () => { diff --git a/packages/web-react/src/components/TextField/__tests__/TextField.test.tsx b/packages/web-react/src/components/TextField/__tests__/TextField.test.tsx index aa32b048d3..2d0ff6ca0e 100644 --- a/packages/web-react/src/components/TextField/__tests__/TextField.test.tsx +++ b/packages/web-react/src/components/TextField/__tests__/TextField.test.tsx @@ -1,16 +1,17 @@ import '@testing-library/jest-dom'; import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { validationStatePropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; -import { validationTextPropsTest } from '../../../../tests/providerTests/validationTextPropsTest'; +import { + classNamePrefixProviderTest, + validationStatePropsTest, + restPropsTest, + stylePropsTest, + validationTextPropsTest, +} from '@local/tests'; import { TextFieldType } from '../../../types'; import TextField from '../TextField'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('TextField', () => { describe.each(['text', 'password', 'email'])('input type %s', (type) => { diff --git a/packages/web-react/src/components/TextFieldBase/__tests__/TextFieldBase.test.tsx b/packages/web-react/src/components/TextFieldBase/__tests__/TextFieldBase.test.tsx index 68f4d00866..384d470a5c 100644 --- a/packages/web-react/src/components/TextFieldBase/__tests__/TextFieldBase.test.tsx +++ b/packages/web-react/src/components/TextFieldBase/__tests__/TextFieldBase.test.tsx @@ -1,7 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { requiredPropsTest } from '../../../../tests/providerTests/requiredPropsTest'; +import { requiredPropsTest } from '@local/tests'; import { TextFieldType } from '../../../types'; import TextFieldBase from '../TextFieldBase'; diff --git a/packages/web-react/src/components/Toast/__tests__/Toast.test.tsx b/packages/web-react/src/components/Toast/__tests__/Toast.test.tsx index 67e906b792..15814cd3a7 100644 --- a/packages/web-react/src/components/Toast/__tests__/Toast.test.tsx +++ b/packages/web-react/src/components/Toast/__tests__/Toast.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Toast from '../Toast'; describe('Toast', () => { diff --git a/packages/web-react/src/components/Toast/__tests__/ToastBar.test.tsx b/packages/web-react/src/components/Toast/__tests__/ToastBar.test.tsx index 41ea9bdb33..08c29d306c 100644 --- a/packages/web-react/src/components/Toast/__tests__/ToastBar.test.tsx +++ b/packages/web-react/src/components/Toast/__tests__/ToastBar.test.tsx @@ -1,13 +1,10 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ToastBar from '../ToastBar'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('ToastBar', () => { classNamePrefixProviderTest((props) => , 'ToastBar'); diff --git a/packages/web-react/src/components/Toast/__tests__/ToastBarLink.test.tsx b/packages/web-react/src/components/Toast/__tests__/ToastBarLink.test.tsx index e199e8a2aa..083f86c835 100644 --- a/packages/web-react/src/components/Toast/__tests__/ToastBarLink.test.tsx +++ b/packages/web-react/src/components/Toast/__tests__/ToastBarLink.test.tsx @@ -1,8 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { restPropsTest, stylePropsTest } from '@local/tests'; import ToastBarLink from '../ToastBarLink'; describe('ToastBarLink', () => { diff --git a/packages/web-react/src/components/Toast/__tests__/ToastBarMessage.test.tsx b/packages/web-react/src/components/Toast/__tests__/ToastBarMessage.test.tsx index 4a12704489..4e38e4c39a 100644 --- a/packages/web-react/src/components/Toast/__tests__/ToastBarMessage.test.tsx +++ b/packages/web-react/src/components/Toast/__tests__/ToastBarMessage.test.tsx @@ -1,8 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { restPropsTest, stylePropsTest } from '@local/tests'; import ToastBarMessage from '../ToastBarMessage'; describe('ToastBarMessage', () => { diff --git a/packages/web-react/src/components/Toast/__tests__/UncontrolledToast.test.tsx b/packages/web-react/src/components/Toast/__tests__/UncontrolledToast.test.tsx index e1c99da864..69042650f1 100644 --- a/packages/web-react/src/components/Toast/__tests__/UncontrolledToast.test.tsx +++ b/packages/web-react/src/components/Toast/__tests__/UncontrolledToast.test.tsx @@ -1,12 +1,11 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; import { ToastLinkProps } from '../../../types'; import { ToastContext } from '../ToastContext'; import UncontrolledToast from '../UncontrolledToast'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); const defaultToast = { id: 'test-id', diff --git a/packages/web-react/src/components/Tooltip/__tests__/Tooltip.test.tsx b/packages/web-react/src/components/Tooltip/__tests__/Tooltip.test.tsx index ec0d632707..d06fbae2c1 100644 --- a/packages/web-react/src/components/Tooltip/__tests__/Tooltip.test.tsx +++ b/packages/web-react/src/components/Tooltip/__tests__/Tooltip.test.tsx @@ -1,8 +1,7 @@ import '@testing-library/jest-dom'; import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { restPropsTest, stylePropsTest } from '@local/tests'; import { Button } from '../../Button'; import { Tooltip, TooltipPopover, TooltipTrigger } from '..'; diff --git a/packages/web-react/src/components/Tooltip/__tests__/TooltipPopover.test.tsx b/packages/web-react/src/components/Tooltip/__tests__/TooltipPopover.test.tsx index 38dc4a6ef4..ba8a9fb945 100644 --- a/packages/web-react/src/components/Tooltip/__tests__/TooltipPopover.test.tsx +++ b/packages/web-react/src/components/Tooltip/__tests__/TooltipPopover.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import { TooltipPopover } from '..'; describe('TooltipPopover', () => { diff --git a/packages/web-react/src/components/Tooltip/__tests__/TooltipTrigger.test.tsx b/packages/web-react/src/components/Tooltip/__tests__/TooltipTrigger.test.tsx index c858a9ff4f..290c30af8d 100644 --- a/packages/web-react/src/components/Tooltip/__tests__/TooltipTrigger.test.tsx +++ b/packages/web-react/src/components/Tooltip/__tests__/TooltipTrigger.test.tsx @@ -1,8 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { restPropsTest, stylePropsTest } from '@local/tests'; import { Button } from '../../Button'; import { TooltipTrigger } from '..'; diff --git a/packages/web-react/src/components/Tooltip/__tests__/UncontrolledTooltip.test.tsx b/packages/web-react/src/components/Tooltip/__tests__/UncontrolledTooltip.test.tsx index 8c2254fe3d..00b5ef1735 100644 --- a/packages/web-react/src/components/Tooltip/__tests__/UncontrolledTooltip.test.tsx +++ b/packages/web-react/src/components/Tooltip/__tests__/UncontrolledTooltip.test.tsx @@ -1,8 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { restPropsTest, stylePropsTest } from '@local/tests'; import UncontrolledTooltip from '../UncontrolledTooltip'; describe('UncontrolledTooltip', () => { diff --git a/packages/web-react/src/components/UNSTABLE_ActionLayout/__tests__/UNSTABLE_ActionLayout.test.tsx b/packages/web-react/src/components/UNSTABLE_ActionLayout/__tests__/UNSTABLE_ActionLayout.test.tsx index e55477ae2d..c24b1233fc 100644 --- a/packages/web-react/src/components/UNSTABLE_ActionLayout/__tests__/UNSTABLE_ActionLayout.test.tsx +++ b/packages/web-react/src/components/UNSTABLE_ActionLayout/__tests__/UNSTABLE_ActionLayout.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import UNSTABLE_ActionLayout from '../UNSTABLE_ActionLayout'; describe('UNSTABLE_ActionLayout', () => { diff --git a/packages/web-react/src/components/UNSTABLE_Avatar/__tests__/UNSTABLE_Avatar.test.tsx b/packages/web-react/src/components/UNSTABLE_Avatar/__tests__/UNSTABLE_Avatar.test.tsx index a8ea426908..68b1210fb7 100644 --- a/packages/web-react/src/components/UNSTABLE_Avatar/__tests__/UNSTABLE_Avatar.test.tsx +++ b/packages/web-react/src/components/UNSTABLE_Avatar/__tests__/UNSTABLE_Avatar.test.tsx @@ -1,15 +1,11 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { sizeExtendedPropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, sizeExtendedPropsTest, restPropsTest, stylePropsTest } from '@local/tests'; import { Icon } from '../../Icon'; import UNSTABLE_Avatar from '../UNSTABLE_Avatar'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('UNSTABLE_Avatar', () => { classNamePrefixProviderTest(UNSTABLE_Avatar, 'UNSTABLE_Avatar'); diff --git a/packages/web-react/src/components/UNSTABLE_EmptyState/__tests__/UNSTABLE_EmptyState.test.tsx b/packages/web-react/src/components/UNSTABLE_EmptyState/__tests__/UNSTABLE_EmptyState.test.tsx index b83382ddc3..a26ca32e89 100644 --- a/packages/web-react/src/components/UNSTABLE_EmptyState/__tests__/UNSTABLE_EmptyState.test.tsx +++ b/packages/web-react/src/components/UNSTABLE_EmptyState/__tests__/UNSTABLE_EmptyState.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import UNSTABLE_EmptyState from '../UNSTABLE_EmptyState'; describe('UNSTABLE_EmptyState', () => { diff --git a/packages/web-react/src/components/UNSTABLE_EmptyState/__tests__/UNSTABLE_EmptyStateSection.test.tsx b/packages/web-react/src/components/UNSTABLE_EmptyState/__tests__/UNSTABLE_EmptyStateSection.test.tsx index 3d50e7715d..fb5aa502a4 100644 --- a/packages/web-react/src/components/UNSTABLE_EmptyState/__tests__/UNSTABLE_EmptyStateSection.test.tsx +++ b/packages/web-react/src/components/UNSTABLE_EmptyState/__tests__/UNSTABLE_EmptyStateSection.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import UNSTABLE_EmptyStateSection from '../UNSTABLE_EmptyStateSection'; describe('UNSTABLE_EmptyStateSection', () => { diff --git a/packages/web-react/src/components/UNSTABLE_Slider/__tests__/UNSTABLE_Slider.test.tsx b/packages/web-react/src/components/UNSTABLE_Slider/__tests__/UNSTABLE_Slider.test.tsx index 3a16f5d250..ad26f98eea 100644 --- a/packages/web-react/src/components/UNSTABLE_Slider/__tests__/UNSTABLE_Slider.test.tsx +++ b/packages/web-react/src/components/UNSTABLE_Slider/__tests__/UNSTABLE_Slider.test.tsx @@ -1,8 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { restPropsTest, stylePropsTest } from '@local/tests'; import UNSTABLE_Slider from '../UNSTABLE_Slider'; describe('UNSTABLE_Slider', () => { diff --git a/packages/web-react/src/components/UNSTABLE_Toggle/__tests__/UNSTABLE_Toggle.test.tsx b/packages/web-react/src/components/UNSTABLE_Toggle/__tests__/UNSTABLE_Toggle.test.tsx index 6d1e057e66..42b22eba4b 100644 --- a/packages/web-react/src/components/UNSTABLE_Toggle/__tests__/UNSTABLE_Toggle.test.tsx +++ b/packages/web-react/src/components/UNSTABLE_Toggle/__tests__/UNSTABLE_Toggle.test.tsx @@ -1,11 +1,13 @@ import '@testing-library/jest-dom'; import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { validationStatePropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { requiredPropsTest } from '../../../../tests/providerTests/requiredPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { + classNamePrefixProviderTest, + validationStatePropsTest, + requiredPropsTest, + restPropsTest, + stylePropsTest, +} from '@local/tests'; import UNSTABLE_Toggle from '../UNSTABLE_Toggle'; describe('UNSTABLE_Toggle', () => { diff --git a/packages/web-react/src/components/UNSTABLE_Truncate/__tests__/UNSTABLE_Truncate.test.tsx b/packages/web-react/src/components/UNSTABLE_Truncate/__tests__/UNSTABLE_Truncate.test.tsx index e05eb208e5..89d2560df1 100644 --- a/packages/web-react/src/components/UNSTABLE_Truncate/__tests__/UNSTABLE_Truncate.test.tsx +++ b/packages/web-react/src/components/UNSTABLE_Truncate/__tests__/UNSTABLE_Truncate.test.tsx @@ -1,9 +1,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import UNSTABLE_Truncate from '../UNSTABLE_Truncate'; describe('UNSTABLE_Truncate', () => { diff --git a/packages/web-react/src/components/VisuallyHidden/__tests__/VisuallyHidden.test.tsx b/packages/web-react/src/components/VisuallyHidden/__tests__/VisuallyHidden.test.tsx index d9f5390955..daef23c4bd 100644 --- a/packages/web-react/src/components/VisuallyHidden/__tests__/VisuallyHidden.test.tsx +++ b/packages/web-react/src/components/VisuallyHidden/__tests__/VisuallyHidden.test.tsx @@ -1,9 +1,7 @@ import { render } from '@testing-library/react'; import React from 'react'; import '@testing-library/jest-dom'; -import { classNamePrefixProviderTest } from '../../../../tests/providerTests/classNamePrefixProviderTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import VisuallyHidden from '../VisuallyHidden'; describe('Visually Hidden', () => { diff --git a/packages/web-react/src/hooks/__mocks__/useIcon.ts b/packages/web-react/src/hooks/__mocks__/useIcon.ts new file mode 100644 index 0000000000..b902a76c36 --- /dev/null +++ b/packages/web-react/src/hooks/__mocks__/useIcon.ts @@ -0,0 +1 @@ +export const useIcon = jest.fn(() => ''); diff --git a/packages/web-react/tests/index.ts b/packages/web-react/tests/index.ts new file mode 100644 index 0000000000..d0c2bf68b4 --- /dev/null +++ b/packages/web-react/tests/index.ts @@ -0,0 +1,2 @@ +export * from './providerTests'; +export * from './testUtils'; diff --git a/packages/web-react/tests/mocks/hooksMock.ts b/packages/web-react/tests/mocks/hooksMock.ts deleted file mode 100644 index e32d8bb842..0000000000 --- a/packages/web-react/tests/mocks/hooksMock.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const useIconMock = { - ...jest.requireActual('../../src/hooks'), - useIcon: () => '', -}; diff --git a/packages/web-react/tests/providerTests/index.ts b/packages/web-react/tests/providerTests/index.ts new file mode 100644 index 0000000000..c531253845 --- /dev/null +++ b/packages/web-react/tests/providerTests/index.ts @@ -0,0 +1,8 @@ +export * from './classNamePrefixProviderTest'; +export * from './dictionaryPropsTest'; +export * from './itemPropsTest'; +export * from './loadingPropsTest'; +export * from './requiredPropsTest'; +export * from './restPropsTest'; +export * from './stylePropsTest'; +export * from './validationTextPropsTest'; diff --git a/packages/web-react/tests/testUtils/index.ts b/packages/web-react/tests/testUtils/index.ts index 1ec9179707..b1022ab927 100644 --- a/packages/web-react/tests/testUtils/index.ts +++ b/packages/web-react/tests/testUtils/index.ts @@ -1,3 +1,5 @@ export * from './renderWithHeaderContext'; export * from './withHeaderContext'; export * from './withHeader'; +export * from './renderWithHeaderContext'; +export * from './withTabsContext'; diff --git a/packages/web-react/tsconfig.json b/packages/web-react/tsconfig.json index 02d6d170cf..f33601f03a 100644 --- a/packages/web-react/tsconfig.json +++ b/packages/web-react/tsconfig.json @@ -11,7 +11,14 @@ // Specify how TypeScript looks up a file from a given module specifier. // @see: https://www.typescriptlang.org/tsconfig/#moduleResolution - "moduleResolution": "nodenext" + "moduleResolution": "nodenext", + + "baseUrl": ".", + + "paths": { + "@local/tests": ["./tests/index.ts"], + "@local/tests/*": ["./tests/*"] + } }, "include": ["./src/**/*"], "exclude": ["./node_modules", "./dist/**/*"] diff --git a/yarn.lock b/yarn.lock index 4d905292e8..d80c97d6ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5089,6 +5089,7 @@ __metadata: eslint: "npm:8.57.1" eslint-config-airbnb: "npm:19.0.4" eslint-config-prettier: "npm:9.1.0" + eslint-import-resolver-typescript: "npm:^3.7.0" eslint-plugin-import: "npm:2.31.0" eslint-plugin-jsx-a11y: "npm:6.10.2" eslint-plugin-prettier: "npm:5.2.1" @@ -14956,6 +14957,31 @@ __metadata: languageName: node linkType: hard +"eslint-import-resolver-typescript@npm:^3.7.0": + version: 3.7.0 + resolution: "eslint-import-resolver-typescript@npm:3.7.0" + dependencies: + "@nolyfill/is-core-module": "npm:1.0.39" + debug: "npm:^4.3.7" + enhanced-resolve: "npm:^5.15.0" + fast-glob: "npm:^3.3.2" + get-tsconfig: "npm:^4.7.5" + is-bun-module: "npm:^1.0.2" + is-glob: "npm:^4.0.3" + stable-hash: "npm:^0.0.4" + peerDependencies: + eslint: "*" + eslint-plugin-import: "*" + eslint-plugin-import-x: "*" + peerDependenciesMeta: + eslint-plugin-import: + optional: true + eslint-plugin-import-x: + optional: true + checksum: 10/8158730c11e562c56ed9bf7236dc75bce35b6992dc32c39ac2f4177ab77fca97b95999850204a6458054243607b54aee88c028a61fed4184f24f425fa1afff01 + languageName: node + linkType: hard + "eslint-module-utils@npm:^2.12.0": version: 2.12.0 resolution: "eslint-module-utils@npm:2.12.0" @@ -28032,6 +28058,13 @@ __metadata: languageName: node linkType: hard +"stable-hash@npm:^0.0.4": + version: 0.0.4 + resolution: "stable-hash@npm:0.0.4" + checksum: 10/21c039d21c1cb739cf8342561753a5e007cb95ea682ccd452e76310bbb9c6987a89de8eda023e320b019f3e4691aabda75079cdbb7dadf7ab9013e931f2f23cd + languageName: node + linkType: hard + "stable@npm:^0.1.8": version: 0.1.8 resolution: "stable@npm:0.1.8"