From 9a9a6d6543da00d864f2aa5a58137a6dc19a773c Mon Sep 17 00:00:00 2001 From: literat Date: Tue, 10 Dec 2024 21:08:17 +0100 Subject: [PATCH 1/5] Test(web-react): Introduce barell files for tests and test providers refs #DS-1611 --- packages/web-react/tests/index.ts | 3 +++ packages/web-react/tests/mocks/index.ts | 1 + packages/web-react/tests/providerTests/index.ts | 8 ++++++++ packages/web-react/tests/testUtils/index.ts | 2 ++ 4 files changed, 14 insertions(+) create mode 100644 packages/web-react/tests/index.ts create mode 100644 packages/web-react/tests/mocks/index.ts create mode 100644 packages/web-react/tests/providerTests/index.ts diff --git a/packages/web-react/tests/index.ts b/packages/web-react/tests/index.ts new file mode 100644 index 0000000000..552eb05607 --- /dev/null +++ b/packages/web-react/tests/index.ts @@ -0,0 +1,3 @@ +export * from './providerTests'; +export * from './testUtils'; +export * from './mocks'; diff --git a/packages/web-react/tests/mocks/index.ts b/packages/web-react/tests/mocks/index.ts new file mode 100644 index 0000000000..d5ff221b08 --- /dev/null +++ b/packages/web-react/tests/mocks/index.ts @@ -0,0 +1 @@ +export * from './hooksMock'; 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'; From fe5222dc8fdccf0518b0e9af5df461b4256ecae2 Mon Sep 17 00:00:00 2001 From: literat Date: Tue, 10 Dec 2024 21:09:22 +0100 Subject: [PATCH 2/5] Chore(web-react): Introduce `@local/tests` path alias for tests refs #DS-1612 --- packages/web-react/.eslintrc.js | 24 ++++++++++++++++++++-- packages/web-react/jest.config.ts | 7 +++++++ packages/web-react/package.json | 1 + packages/web-react/tsconfig.json | 6 +++++- yarn.lock | 33 +++++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 3 deletions(-) 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/tsconfig.json b/packages/web-react/tsconfig.json index c74262afcd..ac9b1dde41 100644 --- a/packages/web-react/tsconfig.json +++ b/packages/web-react/tsconfig.json @@ -25,7 +25,11 @@ "esModuleInterop": true, "skipLibCheck": true, "lib": ["es2016", "dom", "dom.iterable"], - "types": ["jest", "node"] + "types": ["jest", "node"], + "paths": { + "@local/tests": ["./tests/index.ts"], + "@local/tests/*": ["./tests/*"] + } }, "include": ["./src/**/*"], "exclude": ["./node_modules", "./dist/**/*"] diff --git a/yarn.lock b/yarn.lock index 52b3df2419..8bb262ad90 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" From b997fce315af3d080a26898ba81dbc82e3870f69 Mon Sep 17 00:00:00 2001 From: literat Date: Tue, 10 Dec 2024 21:10:03 +0100 Subject: [PATCH 3/5] Refactor(web-react): Use `@local/tests` path alias in tests refs #DS-1612 --- .../Accordion/__tests__/Accordion.test.tsx | 4 +--- .../__tests__/AccordionContent.test.tsx | 4 +--- .../Accordion/__tests__/AccordionHeader.test.tsx | 5 +---- .../Accordion/__tests__/AccordionItem.test.tsx | 5 +---- .../__tests__/UncontrolledAccordion.test.tsx | 5 +---- .../components/Alert/__tests__/Alert.test.tsx | 12 +++++++----- .../Breadcrumbs/__tests__/Breadcrumbs.test.tsx | 5 +---- .../__tests__/BreadcrumbsItem.test.tsx | 5 +---- .../components/Button/__tests__/Button.test.tsx | 12 ++++++------ .../ButtonLink/__tests__/ButtonLink.test.tsx | 12 ++++++------ .../src/components/Card/__tests__/Card.test.tsx | 4 +--- .../Card/__tests__/CardArtwork.test.tsx | 5 +---- .../components/Card/__tests__/CardBody.test.tsx | 4 +--- .../Card/__tests__/CardEyebrow.test.tsx | 4 +--- .../Card/__tests__/CardFooter.test.tsx | 5 +---- .../components/Card/__tests__/CardLink.test.tsx | 4 +--- .../components/Card/__tests__/CardLogo.test.tsx | 4 +--- .../components/Card/__tests__/CardMedia.test.tsx | 5 +---- .../components/Card/__tests__/CardTitle.test.tsx | 4 +--- .../Checkbox/__tests__/Checkbox.test.tsx | 16 +++++++++------- .../Collapse/__tests__/Collapse.test.tsx | 4 +--- .../__tests__/UncontrolledCollapse.test.tsx | 4 +--- .../Container/__tests__/Container.test.tsx | 4 +--- .../Divider/__tests__/Divider.test.tsx | 4 +--- .../Dropdown/__tests__/Dropdown.test.tsx | 4 +--- .../Dropdown/__tests__/DropdownPopover.test.tsx | 4 +--- .../Dropdown/__tests__/DropdownTrigger.test.tsx | 4 +--- .../FieldGroup/__tests__/FieldGroup.test.tsx | 12 +++++++----- .../FileUploader/__tests__/FileUploader.test.tsx | 5 +---- .../__tests__/FileUploaderInput.test.tsx | 5 +---- .../__tests__/FileUploaderList.test.tsx | 2 +- .../src/components/Flex/__tests__/Flex.test.tsx | 4 +--- .../components/Footer/__tests__/Footer.test.tsx | 3 +-- .../src/components/Grid/__tests__/Grid.test.tsx | 4 +--- .../components/Grid/__tests__/GridItem.test.tsx | 4 +--- .../components/Header/__tests__/Header.test.tsx | 4 +--- .../Header/__tests__/HeaderButton.test.tsx | 4 +--- .../__tests__/HeaderDesktopActions.test.tsx | 4 +--- .../Header/__tests__/HeaderDialog.test.tsx | 4 +--- .../__tests__/HeaderDialogActions.test.tsx | 4 +--- .../Header/__tests__/HeaderDialogButton.test.tsx | 4 +--- .../__tests__/HeaderDialogCloseButton.test.tsx | 5 +---- .../Header/__tests__/HeaderDialogLink.test.tsx | 4 +--- .../Header/__tests__/HeaderDialogNav.test.tsx | 4 +--- .../__tests__/HeaderDialogNavItem.test.tsx | 4 +--- .../Header/__tests__/HeaderDialogText.test.tsx | 4 +--- .../Header/__tests__/HeaderLink.test.tsx | 4 +--- .../__tests__/HeaderMobileActions.test.tsx | 5 +---- .../Header/__tests__/HeaderNav.test.tsx | 4 +--- .../Header/__tests__/HeaderNavItem.test.tsx | 4 +--- .../Heading/__tests__/Heading.test.tsx | 11 +++++++---- .../src/components/Icon/__tests__/Icon.test.tsx | 4 +--- .../src/components/Item/__tests__/Item.test.tsx | 4 +--- .../src/components/Link/__tests__/Link.test.tsx | 5 +---- .../components/Modal/__tests__/Modal.test.tsx | 4 +--- .../Modal/__tests__/ModalBody.test.tsx | 4 +--- .../Modal/__tests__/ModalCloseButton.test.tsx | 5 +---- .../Modal/__tests__/ModalDialog.test.tsx | 4 +--- .../Modal/__tests__/ModalFooter.test.tsx | 4 +--- .../Modal/__tests__/ModalHeader.test.tsx | 5 +---- .../Pagination/__tests__/Pagination.test.tsx | 4 +--- .../__tests__/PaginationButtonLink.test.tsx | 5 +---- .../Pagination/__tests__/PaginationItem.test.tsx | 4 +--- .../Pagination/__tests__/PaginationLink.test.tsx | 4 +--- .../__tests__/PaginationLinkNext.test.tsx | 5 +---- .../__tests__/PaginationLinkPrevious.test.tsx | 5 +---- .../__tests__/UncontrolledPagination.test.tsx | 2 +- .../PartnerLogo/__tests__/PartnerLogo.test.tsx | 4 +--- .../src/components/Pill/__tests__/Pill.test.tsx | 5 +---- .../ProductLogo/__tests__/ProductLogo.test.tsx | 4 +--- .../components/Radio/__tests__/Radio.test.tsx | 14 ++++++++------ .../ScrollView/__tests__/ScrollView.test.tsx | 4 +--- .../components/Select/__tests__/Select.test.tsx | 16 +++++++++------- .../Spinner/__tests__/Spinner.test.tsx | 12 +++++++----- .../components/Stack/__tests__/Stack.test.tsx | 4 +--- .../components/Tabs/__tests__/TabItem.test.tsx | 5 +---- .../components/Tabs/__tests__/TabLink.test.tsx | 3 +-- .../components/Tabs/__tests__/TabList.test.tsx | 3 +-- .../components/Tabs/__tests__/TabPane.test.tsx | 5 +---- .../src/components/Tag/__tests__/Tag.test.tsx | 11 +++++++---- .../src/components/Text/__tests__/Text.test.tsx | 11 +++++++---- .../TextArea/__tests__/TextArea.test.tsx | 14 ++++++++------ .../TextField/__tests__/TextField.test.tsx | 14 ++++++++------ .../__tests__/TextFieldBase.test.tsx | 2 +- .../components/Toast/__tests__/Toast.test.tsx | 4 +--- .../components/Toast/__tests__/ToastBar.test.tsx | 5 +---- .../Toast/__tests__/ToastBarLink.test.tsx | 3 +-- .../Toast/__tests__/ToastBarMessage.test.tsx | 3 +-- .../Toast/__tests__/UncontrolledToast.test.tsx | 2 +- .../Tooltip/__tests__/Tooltip.test.tsx | 3 +-- .../Tooltip/__tests__/TooltipPopover.test.tsx | 4 +--- .../Tooltip/__tests__/TooltipTrigger.test.tsx | 3 +-- .../__tests__/UncontrolledTooltip.test.tsx | 3 +-- .../__tests__/UNSTABLE_ActionLayout.test.tsx | 4 +--- .../__tests__/UNSTABLE_Avatar.test.tsx | 12 +++++++----- .../__tests__/UNSTABLE_EmptyState.test.tsx | 4 +--- .../UNSTABLE_EmptyStateSection.test.tsx | 4 +--- .../__tests__/UNSTABLE_Slider.test.tsx | 3 +-- .../__tests__/UNSTABLE_Toggle.test.tsx | 12 +++++++----- .../__tests__/UNSTABLE_Truncate.test.tsx | 4 +--- .../__tests__/VisuallyHidden.test.tsx | 4 +--- 101 files changed, 196 insertions(+), 344 deletions(-) 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..f693c5fd20 100644 --- a/packages/web-react/src/components/Accordion/__tests__/AccordionHeader.test.tsx +++ b/packages/web-react/src/components/Accordion/__tests__/AccordionHeader.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import AccordionHeader from '../AccordionHeader'; import AccordionItem from '../AccordionItem'; 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..9454034d09 100644 --- a/packages/web-react/src/components/Accordion/__tests__/AccordionItem.test.tsx +++ b/packages/web-react/src/components/Accordion/__tests__/AccordionItem.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Accordion from '../Accordion'; import AccordionContent from '../AccordionContent'; import AccordionHeader from '../AccordionHeader'; 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..d5712f35c5 100644 --- a/packages/web-react/src/components/Accordion/__tests__/UncontrolledAccordion.test.tsx +++ b/packages/web-react/src/components/Accordion/__tests__/UncontrolledAccordion.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import AccordionContent from '../AccordionContent'; import AccordionHeader from '../AccordionHeader'; import AccordionItem from '../AccordionItem'; 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..9e5f34bab7 100644 --- a/packages/web-react/src/components/Alert/__tests__/Alert.test.tsx +++ b/packages/web-react/src/components/Alert/__tests__/Alert.test.tsx @@ -1,11 +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 { emotionColorPropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { + useIconMock, + classNamePrefixProviderTest, + emotionColorPropsTest, + restPropsTest, + stylePropsTest, +} from '@local/tests'; import Alert from '../Alert'; jest.mock('../../../hooks', () => useIconMock); 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..a1548a1bdd 100644 --- a/packages/web-react/src/components/Breadcrumbs/__tests__/Breadcrumbs.test.tsx +++ b/packages/web-react/src/components/Breadcrumbs/__tests__/Breadcrumbs.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import Breadcrumbs from '../Breadcrumbs'; jest.mock('../../../hooks', () => useIconMock); 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..dba47e82b4 100644 --- a/packages/web-react/src/components/Breadcrumbs/__tests__/BreadcrumbsItem.test.tsx +++ b/packages/web-react/src/components/Breadcrumbs/__tests__/BreadcrumbsItem.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import BreadcrumbsItem from '../BreadcrumbsItem'; jest.mock('../../../hooks', () => useIconMock); 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..127a9212de 100644 --- a/packages/web-react/src/components/Button/__tests__/Button.test.tsx +++ b/packages/web-react/src/components/Button/__tests__/Button.test.tsx @@ -1,16 +1,16 @@ 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 { + useIconMock, + 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); 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..aaf37dff37 100644 --- a/packages/web-react/src/components/ButtonLink/__tests__/ButtonLink.test.tsx +++ b/packages/web-react/src/components/ButtonLink/__tests__/ButtonLink.test.tsx @@ -1,16 +1,16 @@ 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 { + useIconMock, + 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); 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..67e84fc871 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', () => { 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..8eae315293 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', () => { 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..b543de6be6 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', () => { 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..56b2b145b9 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', () => { 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..dc46a416bc 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', () => { 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..d3c4b221ec 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', () => { 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..3bcbd3580a 100644 --- a/packages/web-react/src/components/Dropdown/__tests__/DropdownTrigger.test.tsx +++ b/packages/web-react/src/components/Dropdown/__tests__/DropdownTrigger.test.tsx @@ -1,9 +1,7 @@ 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 { useIconMock, restPropsTest, stylePropsTest } from '@local/tests'; import { Button } from '../../Button'; import DropdownTrigger from '../DropdownTrigger'; 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..f01c61e0d2 100644 --- a/packages/web-react/src/components/FileUploader/__tests__/FileUploader.test.tsx +++ b/packages/web-react/src/components/FileUploader/__tests__/FileUploader.test.tsx @@ -1,9 +1,6 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import FileUploader from '../FileUploader'; jest.mock('../../../hooks', () => useIconMock); 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..4bdd074d4f 100644 --- a/packages/web-react/src/components/FileUploader/__tests__/FileUploaderInput.test.tsx +++ b/packages/web-react/src/components/FileUploader/__tests__/FileUploaderInput.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, validationTextPropsTest } from '@local/tests'; import FileUploaderInput from '../FileUploaderInput'; import '@testing-library/jest-dom'; 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..4b10324e1b 100644 --- a/packages/web-react/src/components/FileUploader/__tests__/FileUploaderList.test.tsx +++ b/packages/web-react/src/components/FileUploader/__tests__/FileUploaderList.test.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; +import { useIconMock } from '@local/tests'; import { SpiritFileUploaderAttachmentProps } from '../../../types'; import FileUploader from '../FileUploader'; import FileUploaderList from '../FileUploaderList'; 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..999d0acc4f 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderDialogCloseButton.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderDialogCloseButton.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import HeaderDialogCloseButton from '../HeaderDialogCloseButton'; jest.mock('../../../hooks', () => useIconMock); 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..ecb7d9ff37 100644 --- a/packages/web-react/src/components/Header/__tests__/HeaderMobileActions.test.tsx +++ b/packages/web-react/src/components/Header/__tests__/HeaderMobileActions.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import { HEADER_MENU_TOGGLE_LABEL_DEFAULT } from '../constants'; import HeaderMobileActions from '../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..feb621f58a 100644 --- a/packages/web-react/src/components/Icon/__tests__/Icon.test.tsx +++ b/packages/web-react/src/components/Icon/__tests__/Icon.test.tsx @@ -1,9 +1,7 @@ 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 { useIconMock, restPropsTest, stylePropsTest } from '@local/tests'; import Icon from '../Icon'; jest.mock('../../../hooks', () => useIconMock); 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..94bc90a151 100644 --- a/packages/web-react/src/components/Item/__tests__/Item.test.tsx +++ b/packages/web-react/src/components/Item/__tests__/Item.test.tsx @@ -1,9 +1,7 @@ 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 { useIconMock, restPropsTest, stylePropsTest } from '@local/tests'; import { SpiritItemProps } from '../../../types'; import Item from '../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..9a9f66ce2c 100644 --- a/packages/web-react/src/components/Modal/__tests__/ModalCloseButton.test.tsx +++ b/packages/web-react/src/components/Modal/__tests__/ModalCloseButton.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ModalCloseButton from '../ModalCloseButton'; jest.mock('../../../hooks', () => useIconMock); 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..1cb3e91456 100644 --- a/packages/web-react/src/components/Modal/__tests__/ModalHeader.test.tsx +++ b/packages/web-react/src/components/Modal/__tests__/ModalHeader.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ModalHeader from '../ModalHeader'; jest.mock('../../../hooks', () => useIconMock); 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..3f6ba66439 100644 --- a/packages/web-react/src/components/Pagination/__tests__/PaginationButtonLink.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/PaginationButtonLink.test.tsx @@ -1,8 +1,5 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import PaginationButtonLink from '../PaginationButtonLink'; jest.mock('../../../hooks', () => useIconMock); 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..7fa9514fe9 100644 --- a/packages/web-react/src/components/Pagination/__tests__/PaginationLinkNext.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/PaginationLinkNext.test.tsx @@ -1,8 +1,5 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import PaginationLinkNext from '../PaginationLinkNext'; jest.mock('../../../hooks', () => useIconMock); 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..6e1185c72b 100644 --- a/packages/web-react/src/components/Pagination/__tests__/PaginationLinkPrevious.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/PaginationLinkPrevious.test.tsx @@ -1,8 +1,5 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import PaginationLinkPrevious from '../PaginationLinkPrevious'; jest.mock('../../../hooks', () => useIconMock); 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..41e269569a 100644 --- a/packages/web-react/src/components/Pagination/__tests__/UncontrolledPagination.test.tsx +++ b/packages/web-react/src/components/Pagination/__tests__/UncontrolledPagination.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; +import { useIconMock } from '@local/tests'; import UncontrolledPagination from '../UncontrolledPagination'; jest.mock('../../../hooks', () => useIconMock); 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..428dfa3095 100644 --- a/packages/web-react/src/components/Select/__tests__/Select.test.tsx +++ b/packages/web-react/src/components/Select/__tests__/Select.test.tsx @@ -1,13 +1,15 @@ 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 { + useIconMock, + classNamePrefixProviderTest, + validationStatePropsTest, + requiredPropsTest, + restPropsTest, + stylePropsTest, + validationTextPropsTest, +} from '@local/tests'; import Select from '../Select'; jest.mock('../../../hooks', () => useIconMock); 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..0716e97143 100644 --- a/packages/web-react/src/components/Spinner/__tests__/Spinner.test.tsx +++ b/packages/web-react/src/components/Spinner/__tests__/Spinner.test.tsx @@ -1,11 +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 { textColorPropsTest } from '../../../../tests/providerTests/dictionaryPropsTest'; -import { restPropsTest } from '../../../../tests/providerTests/restPropsTest'; -import { stylePropsTest } from '../../../../tests/providerTests/stylePropsTest'; +import { + useIconMock, + classNamePrefixProviderTest, + textColorPropsTest, + restPropsTest, + stylePropsTest, +} from '@local/tests'; import Spinner from '../Spinner'; jest.mock('../../../hooks', () => useIconMock); 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..dea922bbab 100644 --- a/packages/web-react/src/components/TextField/__tests__/TextField.test.tsx +++ b/packages/web-react/src/components/TextField/__tests__/TextField.test.tsx @@ -1,12 +1,14 @@ 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 { + useIconMock, + classNamePrefixProviderTest, + validationStatePropsTest, + restPropsTest, + stylePropsTest, + validationTextPropsTest, +} from '@local/tests'; import { TextFieldType } from '../../../types'; import TextField from '../TextField'; 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..ede3a7026c 100644 --- a/packages/web-react/src/components/Toast/__tests__/ToastBar.test.tsx +++ b/packages/web-react/src/components/Toast/__tests__/ToastBar.test.tsx @@ -1,10 +1,7 @@ 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 { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; import ToastBar from '../ToastBar'; jest.mock('../../../hooks', () => useIconMock); 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..95d9dac81b 100644 --- a/packages/web-react/src/components/Toast/__tests__/UncontrolledToast.test.tsx +++ b/packages/web-react/src/components/Toast/__tests__/UncontrolledToast.test.tsx @@ -1,7 +1,7 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock } from '../../../../tests/mocks/hooksMock'; +import { useIconMock } from '@local/tests'; import { ToastLinkProps } from '../../../types'; import { ToastContext } from '../ToastContext'; import UncontrolledToast from '../UncontrolledToast'; 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..eae0530fb0 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,11 +1,13 @@ 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 { + useIconMock, + classNamePrefixProviderTest, + sizeExtendedPropsTest, + restPropsTest, + stylePropsTest, +} from '@local/tests'; import { Icon } from '../../Icon'; import UNSTABLE_Avatar from '../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', () => { From 3b281f4f190213e6ac0e132d57166bf8de7c9d70 Mon Sep 17 00:00:00 2001 From: literat Date: Tue, 17 Dec 2024 17:40:44 +0100 Subject: [PATCH 4/5] Test(web-react): Use Jest's automock functionality to share useIcon mock between tests --- .../Accordion/__tests__/AccordionHeader.test.tsx | 4 ++-- .../Accordion/__tests__/AccordionItem.test.tsx | 4 ++-- .../Accordion/__tests__/UncontrolledAccordion.test.tsx | 4 ++-- .../src/components/Alert/__tests__/Alert.test.tsx | 10 ++-------- .../Breadcrumbs/__tests__/Breadcrumbs.test.tsx | 4 ++-- .../Breadcrumbs/__tests__/BreadcrumbsItem.test.tsx | 4 ++-- .../src/components/Button/__tests__/Button.test.tsx | 3 +-- .../ButtonLink/__tests__/ButtonLink.test.tsx | 3 +-- .../Dropdown/__tests__/DropdownTrigger.test.tsx | 4 ++-- .../FileUploader/__tests__/FileUploader.test.tsx | 4 ++-- .../FileUploader/__tests__/FileUploaderInput.test.tsx | 4 ++-- .../FileUploader/__tests__/FileUploaderList.test.tsx | 3 +-- .../Header/__tests__/HeaderDialogCloseButton.test.tsx | 4 ++-- .../Header/__tests__/HeaderMobileActions.test.tsx | 4 ++-- .../src/components/Icon/__tests__/Icon.test.tsx | 4 ++-- .../src/components/Item/__tests__/Item.test.tsx | 4 ++-- .../Modal/__tests__/ModalCloseButton.test.tsx | 4 ++-- .../components/Modal/__tests__/ModalHeader.test.tsx | 4 ++-- .../Pagination/__tests__/PaginationButtonLink.test.tsx | 4 ++-- .../Pagination/__tests__/PaginationLinkNext.test.tsx | 4 ++-- .../__tests__/PaginationLinkPrevious.test.tsx | 4 ++-- .../__tests__/UncontrolledPagination.test.tsx | 3 +-- .../src/components/Select/__tests__/Select.test.tsx | 3 +-- .../src/components/Spinner/__tests__/Spinner.test.tsx | 10 ++-------- .../components/TextField/__tests__/TextField.test.tsx | 3 +-- .../src/components/Toast/__tests__/ToastBar.test.tsx | 4 ++-- .../Toast/__tests__/UncontrolledToast.test.tsx | 3 +-- .../UNSTABLE_Avatar/__tests__/UNSTABLE_Avatar.test.tsx | 10 ++-------- packages/web-react/src/hooks/__mocks__/useIcon.ts | 1 + packages/web-react/tests/index.ts | 1 - packages/web-react/tests/mocks/hooksMock.ts | 4 ---- packages/web-react/tests/mocks/index.ts | 1 - 32 files changed, 50 insertions(+), 80 deletions(-) create mode 100644 packages/web-react/src/hooks/__mocks__/useIcon.ts delete mode 100644 packages/web-react/tests/mocks/hooksMock.ts delete mode 100644 packages/web-react/tests/mocks/index.ts 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 f693c5fd20..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,11 +1,11 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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 9454034d09..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,13 +1,13 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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 d5712f35c5..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,13 +1,13 @@ import '@testing-library/jest-dom'; import { fireEvent, render } from '@testing-library/react'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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 9e5f34bab7..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,16 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { - useIconMock, - classNamePrefixProviderTest, - emotionColorPropsTest, - restPropsTest, - stylePropsTest, -} from '@local/tests'; +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 a1548a1bdd..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,10 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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 dba47e82b4..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,10 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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 127a9212de..b2407b336f 100644 --- a/packages/web-react/src/components/Button/__tests__/Button.test.tsx +++ b/packages/web-react/src/components/Button/__tests__/Button.test.tsx @@ -2,7 +2,6 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; import { - useIconMock, classNamePrefixProviderTest, actionButtonColorPropsTest, emotionColorPropsTest, @@ -13,7 +12,7 @@ import { } 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 aaf37dff37..11a804fc7d 100644 --- a/packages/web-react/src/components/ButtonLink/__tests__/ButtonLink.test.tsx +++ b/packages/web-react/src/components/ButtonLink/__tests__/ButtonLink.test.tsx @@ -2,7 +2,6 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; import { - useIconMock, classNamePrefixProviderTest, actionButtonColorPropsTest, emotionColorPropsTest, @@ -13,7 +12,7 @@ import { } 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/Dropdown/__tests__/DropdownTrigger.test.tsx b/packages/web-react/src/components/Dropdown/__tests__/DropdownTrigger.test.tsx index 3bcbd3580a..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,11 +1,11 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock, restPropsTest, stylePropsTest } from '@local/tests'; +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/FileUploader/__tests__/FileUploader.test.tsx b/packages/web-react/src/components/FileUploader/__tests__/FileUploader.test.tsx index f01c61e0d2..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,9 +1,9 @@ import '@testing-library/jest-dom'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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 4bdd074d4f..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,11 +1,11 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { renderToString } from 'react-dom/server'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, validationTextPropsTest } from '@local/tests'; +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 4b10324e1b..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 '@local/tests'; 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/Header/__tests__/HeaderDialogCloseButton.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderDialogCloseButton.test.tsx index 999d0acc4f..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,10 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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__/HeaderMobileActions.test.tsx b/packages/web-react/src/components/Header/__tests__/HeaderMobileActions.test.tsx index ecb7d9ff37..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,11 +1,11 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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/Icon/__tests__/Icon.test.tsx b/packages/web-react/src/components/Icon/__tests__/Icon.test.tsx index feb621f58a..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,10 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock, restPropsTest, stylePropsTest } from '@local/tests'; +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 94bc90a151..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,11 +1,11 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { useIconMock, restPropsTest, stylePropsTest } from '@local/tests'; +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/Modal/__tests__/ModalCloseButton.test.tsx b/packages/web-react/src/components/Modal/__tests__/ModalCloseButton.test.tsx index 9a9f66ce2c..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,10 +1,10 @@ import '@testing-library/jest-dom'; import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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__/ModalHeader.test.tsx b/packages/web-react/src/components/Modal/__tests__/ModalHeader.test.tsx index 1cb3e91456..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,10 +1,10 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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__/PaginationButtonLink.test.tsx b/packages/web-react/src/components/Pagination/__tests__/PaginationButtonLink.test.tsx index 3f6ba66439..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,8 +1,8 @@ import '@testing-library/jest-dom'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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__/PaginationLinkNext.test.tsx b/packages/web-react/src/components/Pagination/__tests__/PaginationLinkNext.test.tsx index 7fa9514fe9..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,8 +1,8 @@ import '@testing-library/jest-dom'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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 6e1185c72b..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,8 +1,8 @@ import '@testing-library/jest-dom'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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 41e269569a..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 '@local/tests'; 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/Select/__tests__/Select.test.tsx b/packages/web-react/src/components/Select/__tests__/Select.test.tsx index 428dfa3095..6e530e125d 100644 --- a/packages/web-react/src/components/Select/__tests__/Select.test.tsx +++ b/packages/web-react/src/components/Select/__tests__/Select.test.tsx @@ -2,7 +2,6 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; import { - useIconMock, classNamePrefixProviderTest, validationStatePropsTest, requiredPropsTest, @@ -12,7 +11,7 @@ import { } 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 0716e97143..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,16 +1,10 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import React from 'react'; -import { - useIconMock, - classNamePrefixProviderTest, - textColorPropsTest, - restPropsTest, - stylePropsTest, -} from '@local/tests'; +import { classNamePrefixProviderTest, textColorPropsTest, restPropsTest, stylePropsTest } from '@local/tests'; import Spinner from '../Spinner'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('Spinner', () => { classNamePrefixProviderTest(Spinner, 'animation-spin-clockwise'); 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 dea922bbab..2d0ff6ca0e 100644 --- a/packages/web-react/src/components/TextField/__tests__/TextField.test.tsx +++ b/packages/web-react/src/components/TextField/__tests__/TextField.test.tsx @@ -2,7 +2,6 @@ import '@testing-library/jest-dom'; import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; import { - useIconMock, classNamePrefixProviderTest, validationStatePropsTest, restPropsTest, @@ -12,7 +11,7 @@ import { 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/Toast/__tests__/ToastBar.test.tsx b/packages/web-react/src/components/Toast/__tests__/ToastBar.test.tsx index ede3a7026c..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,10 +1,10 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { useIconMock, classNamePrefixProviderTest, restPropsTest, stylePropsTest } from '@local/tests'; +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__/UncontrolledToast.test.tsx b/packages/web-react/src/components/Toast/__tests__/UncontrolledToast.test.tsx index 95d9dac81b..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 '@local/tests'; 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/UNSTABLE_Avatar/__tests__/UNSTABLE_Avatar.test.tsx b/packages/web-react/src/components/UNSTABLE_Avatar/__tests__/UNSTABLE_Avatar.test.tsx index eae0530fb0..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,17 +1,11 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import React from 'react'; -import { - useIconMock, - classNamePrefixProviderTest, - sizeExtendedPropsTest, - restPropsTest, - stylePropsTest, -} from '@local/tests'; +import { classNamePrefixProviderTest, sizeExtendedPropsTest, restPropsTest, stylePropsTest } from '@local/tests'; import { Icon } from '../../Icon'; import UNSTABLE_Avatar from '../UNSTABLE_Avatar'; -jest.mock('../../../hooks', () => useIconMock); +jest.mock('../../../hooks/useIcon'); describe('UNSTABLE_Avatar', () => { classNamePrefixProviderTest(UNSTABLE_Avatar, 'UNSTABLE_Avatar'); 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 index 552eb05607..d0c2bf68b4 100644 --- a/packages/web-react/tests/index.ts +++ b/packages/web-react/tests/index.ts @@ -1,3 +1,2 @@ export * from './providerTests'; export * from './testUtils'; -export * from './mocks'; 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/mocks/index.ts b/packages/web-react/tests/mocks/index.ts deleted file mode 100644 index d5ff221b08..0000000000 --- a/packages/web-react/tests/mocks/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './hooksMock'; From fa7e713d64234f8787a4409bfeb7b09557274db8 Mon Sep 17 00:00:00 2001 From: literat Date: Tue, 17 Dec 2024 17:45:46 +0100 Subject: [PATCH 5/5] Test(web-react): Fix typo in `data-testid` attribute --- .../web-react/src/components/Card/__tests__/Card.test.tsx | 2 +- .../src/components/Card/__tests__/CardArtwork.test.tsx | 4 ++-- .../src/components/Card/__tests__/CardEyebrow.test.tsx | 4 ++-- .../src/components/Card/__tests__/CardLogo.test.tsx | 4 ++-- .../src/components/Card/__tests__/CardMedia.test.tsx | 6 +++--- .../src/components/Card/__tests__/CardTitle.test.tsx | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) 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 67e84fc871..0651910889 100644 --- a/packages/web-react/src/components/Card/__tests__/Card.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/Card.test.tsx @@ -18,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 8eae315293..2da564fd31 100644 --- a/packages/web-react/src/components/Card/__tests__/CardArtwork.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardArtwork.test.tsx @@ -14,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__/CardEyebrow.test.tsx b/packages/web-react/src/components/Card/__tests__/CardEyebrow.test.tsx index b543de6be6..c01e70ad7d 100644 --- a/packages/web-react/src/components/Card/__tests__/CardEyebrow.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardEyebrow.test.tsx @@ -12,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__/CardLogo.test.tsx b/packages/web-react/src/components/Card/__tests__/CardLogo.test.tsx index 56b2b145b9..a6435977e0 100644 --- a/packages/web-react/src/components/Card/__tests__/CardLogo.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardLogo.test.tsx @@ -12,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 dc46a416bc..da894fb101 100644 --- a/packages/web-react/src/components/Card/__tests__/CardMedia.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardMedia.test.tsx @@ -14,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 d3c4b221ec..ab76be71e6 100644 --- a/packages/web-react/src/components/Card/__tests__/CardTitle.test.tsx +++ b/packages/web-react/src/components/Card/__tests__/CardTitle.test.tsx @@ -12,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'); });