From bed85f4af0b56c0e56f320718e87e8c11453dcca Mon Sep 17 00:00:00 2001 From: Victor Genaev Date: Thu, 21 Sep 2023 19:01:44 +0200 Subject: [PATCH] chore: import jest-dom matchers after update --- package.json | 2 +- packages/orbit-components/config/jestSetupFramework.ts | 2 +- packages/orbit-components/cypress/support/commands.ts | 5 ----- packages/orbit-components/cypress/support/e2e.ts | 4 +++- packages/orbit-components/package.json | 2 +- .../orbit-components/src/Wizard/__tests__/compact.test.tsx | 2 +- packages/orbit-components/tsconfig.json | 2 +- packages/orbit-tailwind-preset/config/jestSetupFramework.ts | 2 +- yarn.lock | 4 ++-- 9 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 packages/orbit-components/cypress/support/commands.ts diff --git a/package.json b/package.json index d67de065f7..40b4e96b59 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@size-limit/webpack": "^8.0.0", "@stylelint/postcss-css-in-js": "^0.38.0", "@testing-library/cypress": "^8.0.0", - "@testing-library/jest-dom": "^5.11.10", + "@testing-library/jest-dom": "^6.1.3", "@testing-library/react": "^13.4.0", "@testing-library/react-hooks": "^7.0.0", "@testing-library/user-event": "^14.4.0", diff --git a/packages/orbit-components/config/jestSetupFramework.ts b/packages/orbit-components/config/jestSetupFramework.ts index b3e0ef9275..29a33d6522 100644 --- a/packages/orbit-components/config/jestSetupFramework.ts +++ b/packages/orbit-components/config/jestSetupFramework.ts @@ -1,7 +1,7 @@ import { TextEncoder } from "util"; import { configure } from "@testing-library/react"; import "jest-styled-components"; -import "@testing-library/jest-dom/extend-expect"; +import "@testing-library/jest-dom"; configure({ testIdAttribute: "data-test", diff --git a/packages/orbit-components/cypress/support/commands.ts b/packages/orbit-components/cypress/support/commands.ts deleted file mode 100644 index 4491dcfd2e..0000000000 --- a/packages/orbit-components/cypress/support/commands.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { configure } from "@testing-library/cypress"; - -configure({ - testIdAttribute: "data-test", -}); diff --git a/packages/orbit-components/cypress/support/e2e.ts b/packages/orbit-components/cypress/support/e2e.ts index 1294fc1f41..01cad7631a 100644 --- a/packages/orbit-components/cypress/support/e2e.ts +++ b/packages/orbit-components/cypress/support/e2e.ts @@ -1,5 +1,7 @@ -import "./commands"; +import { configure } from "@testing-library/cypress"; /// /// import "@testing-library/cypress/add-commands"; + +configure({ testIdAttribute: "data-test" }); diff --git a/packages/orbit-components/package.json b/packages/orbit-components/package.json index 20add67ebe..807a1548b3 100644 --- a/packages/orbit-components/package.json +++ b/packages/orbit-components/package.json @@ -120,7 +120,7 @@ "eslint-plugin-storybook": "^0.6.12", "flowgen": "^1.20.1", "fs-extra": "^9.0.1", - "jest-styled-components": "^7.0.5", + "jest-styled-components": "^7.1.1", "jscodeshift": "^0.13.1", "jsdom": "^20.0.3", "loki": "^0.30.3", diff --git a/packages/orbit-components/src/Wizard/__tests__/compact.test.tsx b/packages/orbit-components/src/Wizard/__tests__/compact.test.tsx index 5166421da8..744cd51e90 100644 --- a/packages/orbit-components/src/Wizard/__tests__/compact.test.tsx +++ b/packages/orbit-components/src/Wizard/__tests__/compact.test.tsx @@ -7,7 +7,7 @@ import Wizard, { WizardStep } from ".."; jest.mock("../../hooks/useMediaQuery", () => () => ({ isLargeMobile: false })); describe("Wizard", () => { - const user = userEvent.setup({ delay: null }); + const user = userEvent.setup(); describe("compact", () => { it("shows the current position", () => { diff --git a/packages/orbit-components/tsconfig.json b/packages/orbit-components/tsconfig.json index b2106a973f..4b954cc1b1 100644 --- a/packages/orbit-components/tsconfig.json +++ b/packages/orbit-components/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "lib", "skipLibCheck": true, "noEmit": true, - "types": ["node", "jest", "@testing-library/jest-dom"], + "types": ["node", "jest", "@testing-library/jest-dom", "jest-styled-components"], "moduleResolution": "node", "importsNotUsedAsValues": "error" }, diff --git a/packages/orbit-tailwind-preset/config/jestSetupFramework.ts b/packages/orbit-tailwind-preset/config/jestSetupFramework.ts index 36fc1786b2..4127e43257 100644 --- a/packages/orbit-tailwind-preset/config/jestSetupFramework.ts +++ b/packages/orbit-tailwind-preset/config/jestSetupFramework.ts @@ -1,5 +1,5 @@ import { configure } from "@testing-library/react"; -import "@testing-library/jest-dom/extend-expect"; +import "@testing-library/jest-dom"; configure({ testIdAttribute: "data-test", diff --git a/yarn.lock b/yarn.lock index 997ef4e356..dbbbe078c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16217,9 +16217,9 @@ jest-snapshot@^29.3.1: pretty-format "^29.3.1" semver "^7.3.5" -jest-styled-components@^7.0.5: +jest-styled-components@^7.1.1: version "7.1.1" - resolved "https://registry.npmjs.org/jest-styled-components/-/jest-styled-components-7.1.1.tgz" + resolved "https://registry.yarnpkg.com/jest-styled-components/-/jest-styled-components-7.1.1.tgz#faf19c733e0de4bbef1f9151955b99e839b7df48" integrity sha512-OUq31R5CivBF8oy81dnegNQrRW13TugMol/Dz6ZnFfEyo03exLASod7YGwyHGuayYlKmCstPtz0RQ1+NrAbIIA== dependencies: "@adobe/css-tools" "^4.0.1"