From 51303190b33192a0f8b546efd2c0187c77eff71c Mon Sep 17 00:00:00 2001 From: George Kartalis Date: Thu, 12 Dec 2024 14:29:37 +0100 Subject: [PATCH 1/2] build(deps): bump @testing-library/react-native to latest --- package.json | 2 +- yarn.lock | 39 +++++++-------------------------------- 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index a985ee6dec6..b77e34c5a18 100644 --- a/package.json +++ b/package.json @@ -226,7 +226,7 @@ "@react-native/typescript-config": "0.75.4", "@testing-library/jest-native": "5.4.3", "@testing-library/react-hooks": "8.0.1", - "@testing-library/react-native": "12.4.5", + "@testing-library/react-native": "12.9.0", "@types/argparse": "2.0.10", "@types/autosuggest-highlight": "3.2.3", "@types/chalk": "2.2.0", diff --git a/yarn.lock b/yarn.lock index eabf475df12..6c3334b9456 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4761,10 +4761,10 @@ "@babel/runtime" "^7.12.5" react-error-boundary "^3.1.0" -"@testing-library/react-native@12.4.5": - version "12.4.5" - resolved "https://registry.yarnpkg.com/@testing-library/react-native/-/react-native-12.4.5.tgz#16528aeae7b29238872478f3d1132a2bf821365d" - integrity sha512-SfwFwV1MrnvL//9T4C4UyusnZfWy2IOftNU7mG+bspk23bDM9HH1TxsMvec7JVZleraicDO7tP1odFqwb4KPcg== +"@testing-library/react-native@12.9.0": + version "12.9.0" + resolved "https://registry.yarnpkg.com/@testing-library/react-native/-/react-native-12.9.0.tgz#9c727d9ffec91024be3288ed9376df3673154784" + integrity sha512-wIn/lB1FjV2N4Q7i9PWVRck3Ehwq5pkhAef5X5/bmQ78J/NoOsGbVY2/DG5Y9Lxw+RfE+GvSEh/fe5Tz6sKSvw== dependencies: jest-matcher-utils "^29.7.0" pretty-format "^29.7.0" @@ -14665,16 +14665,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -14788,7 +14779,7 @@ stringify-entities@^3.1.0: character-entities-legacy "^1.0.0" xtend "^4.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -14802,13 +14793,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" @@ -16219,7 +16203,7 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -16237,15 +16221,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 1e37c0985b4379cdec339bfcab8d9d2962197118 Mon Sep 17 00:00:00 2001 From: George Kartalis Date: Thu, 12 Dec 2024 14:44:31 +0100 Subject: [PATCH 2/2] refactor: remove deprecated jest matchers --- jest.config.js | 2 +- package.json | 1 - .../__tests__/ProfessionStep.tests.tsx | 2 +- .../screens/SavedSearchFilterScreen.tests.tsx | 2 - src/setupJest.tsx | 2 +- yarn.lock | 45 ------------------- 6 files changed, 3 insertions(+), 51 deletions(-) diff --git a/jest.config.js b/jest.config.js index 26589ae088d..c26ba9655e9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,7 +8,7 @@ module.exports = { rootDir: "./", setupFilesAfterEnv: [ "jest-extended/all", - "@testing-library/jest-native/extend-expect", + "@testing-library/react-native/extend-expect", "./src/setupJest.tsx", "./node_modules/react-native-gesture-handler/jestSetup.js", ], diff --git a/package.json b/package.json index b77e34c5a18..047807d6576 100644 --- a/package.json +++ b/package.json @@ -224,7 +224,6 @@ "@react-native/eslint-config": "0.75.4", "@react-native/metro-config": "0.75.4", "@react-native/typescript-config": "0.75.4", - "@testing-library/jest-native": "5.4.3", "@testing-library/react-hooks": "8.0.1", "@testing-library/react-native": "12.9.0", "@types/argparse": "2.0.10", diff --git a/src/app/Scenes/CompleteMyProfile/__tests__/ProfessionStep.tests.tsx b/src/app/Scenes/CompleteMyProfile/__tests__/ProfessionStep.tests.tsx index 331fa0a4033..29af53b9da6 100644 --- a/src/app/Scenes/CompleteMyProfile/__tests__/ProfessionStep.tests.tsx +++ b/src/app/Scenes/CompleteMyProfile/__tests__/ProfessionStep.tests.tsx @@ -48,6 +48,6 @@ describe("ProfessionStep", () => { renderWithWrappers() - expect(screen.getByLabelText("Profession")).toHaveAccessibilityValue("Curator") + expect(screen.getByLabelText("Profession")).toHaveAccessibilityValue({ text: "Curator" }) }) }) diff --git a/src/app/Scenes/SavedSearchAlert/screens/SavedSearchFilterScreen.tests.tsx b/src/app/Scenes/SavedSearchAlert/screens/SavedSearchFilterScreen.tests.tsx index 0bf473a177a..e8b8236ed0e 100644 --- a/src/app/Scenes/SavedSearchAlert/screens/SavedSearchFilterScreen.tests.tsx +++ b/src/app/Scenes/SavedSearchAlert/screens/SavedSearchFilterScreen.tests.tsx @@ -27,8 +27,6 @@ describe("ClearAllButton", () => { ) - expect(screen.getByText("Clear All")).toHaveAccessibilityState({ disabled: false }) - fireEvent(screen.getByText("Clear All"), "onPress") expect(Alert.alert).toHaveBeenCalled() diff --git a/src/setupJest.tsx b/src/setupJest.tsx index 0fd6304bdb4..329075a2c55 100644 --- a/src/setupJest.tsx +++ b/src/setupJest.tsx @@ -6,7 +6,7 @@ import mockClipboard from "@react-native-clipboard/clipboard/jest/clipboard-mock import mockRNCNetInfo from "@react-native-community/netinfo/jest/netinfo-mock.js" // @ts-ignore-next-line import mockStripe from "@stripe/stripe-react-native/jest/mock.js" -import "@testing-library/jest-native/extend-expect" +import "@testing-library/react-native/extend-expect" import { ArtsyNativeModule } from "app/NativeModules/ArtsyNativeModule" import { LegacyNativeModules } from "app/NativeModules/LegacyNativeModules" import { ScreenDimensionsWithSafeAreas } from "app/utils/hooks" diff --git a/yarn.lock b/yarn.lock index 6c3334b9456..f14f15a0957 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4742,17 +4742,6 @@ dependencies: defer-to-connect "^2.0.0" -"@testing-library/jest-native@5.4.3": - version "5.4.3" - resolved "https://registry.yarnpkg.com/@testing-library/jest-native/-/jest-native-5.4.3.tgz#9334c68eaf45db9eb20d0876728cc5d7fc2c3ea2" - integrity sha512-/sSDGaOuE+PJ1Z9Kp4u7PQScSVVXGud59I/qsBFFJvIbcn4P6yYw6cBnBmbPF+X9aRIsTJRDl6gzw5ZkJNm66w== - dependencies: - chalk "^4.1.2" - jest-diff "^29.0.1" - jest-matcher-utils "^29.0.1" - pretty-format "^29.0.3" - redent "^3.0.0" - "@testing-library/react-hooks@8.0.1": version "8.0.1" resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-8.0.1.tgz#0924bbd5b55e0c0c0502d1754657ada66947ca12" @@ -7551,11 +7540,6 @@ dezalgo@^1.0.4: asap "^2.0.0" wrappy "1" -diff-sequences@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.0.0.tgz#bae49972ef3933556bcb0800b72e8579d19d9e4f" - integrity sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA== - diff-sequences@^29.3.1: version "29.3.1" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" @@ -10381,16 +10365,6 @@ jest-diff@^29.0.0, jest-diff@^29.7.0: jest-get-type "^29.6.3" pretty-format "^29.7.0" -jest-diff@^29.0.1, jest-diff@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.1.2.tgz#bb7aaf5353227d6f4f96c5e7e8713ce576a607dc" - integrity sha512-4GQts0aUopVvecIT4IwD/7xsBaMhKTYoM4/njE/aVw9wpw+pIUVp8Vab/KnSzSilr84GnLBkaP3JLDnQYCKqVQ== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.0.0" - jest-get-type "^29.0.0" - pretty-format "^29.1.2" - jest-diff@^29.3.1: version "29.3.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.3.1.tgz#d8215b72fed8f1e647aed2cae6c752a89e757527" @@ -10513,16 +10487,6 @@ jest-leak-detector@^29.7.0: jest-get-type "^29.6.3" pretty-format "^29.7.0" -jest-matcher-utils@^29.0.1: - version "29.1.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.1.2.tgz#e68c4bcc0266e70aa1a5c13fb7b8cd4695e318a1" - integrity sha512-MV5XrD3qYSW2zZSHRRceFzqJ39B2z11Qv0KPyZYxnzDHFeYZGJlgGi0SW+IXSJfOewgJp/Km/7lpcFT+cgZypw== - dependencies: - chalk "^4.0.0" - jest-diff "^29.1.2" - jest-get-type "^29.0.0" - pretty-format "^29.1.2" - jest-matcher-utils@^29.3.1: version "29.3.1" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.3.1.tgz#6e7f53512f80e817dfa148672bd2d5d04914a572" @@ -12780,15 +12744,6 @@ pretty-format@^29.0.0: ansi-styles "^5.0.0" react-is "^18.0.0" -pretty-format@^29.0.3, pretty-format@^29.1.2: - version "29.1.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.1.2.tgz#b1f6b75be7d699be1a051f5da36e8ae9e76a8e6a" - integrity sha512-CGJ6VVGXVRP2o2Dorl4mAwwvDWT25luIsYhkyVQW32E4nL+TgW939J7LlKT/npq5Cpq6j3s+sy+13yk7xYpBmg== - dependencies: - "@jest/schemas" "^29.0.0" - ansi-styles "^5.0.0" - react-is "^18.0.0" - pretty-format@^29.3.1: version "29.3.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da"