diff --git a/packages/core-app-api/package.json b/packages/core-app-api/package.json index 18d20f4afc..e4a01a5cb0 100644 --- a/packages/core-app-api/package.json +++ b/packages/core-app-api/package.json @@ -50,7 +50,7 @@ "@backstage/test-utils-core": "^0.1.2", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.4.2", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", diff --git a/packages/core-components/package.json b/packages/core-components/package.json index 48f8dc116b..e3c06c1e6a 100644 --- a/packages/core-components/package.json +++ b/packages/core-components/package.json @@ -37,7 +37,6 @@ "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", - "@testing-library/react-hooks": "^3.4.2", "@types/dagre": "^0.7.44", "@types/prop-types": "^15.7.3", "@types/react": "*", @@ -75,6 +74,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/classnames": "^2.2.9", "@types/d3-selection": "^2.0.0", diff --git a/packages/core-plugin-api/package.json b/packages/core-plugin-api/package.json index abd64bd4d5..7f84ee1620 100644 --- a/packages/core-plugin-api/package.json +++ b/packages/core-plugin-api/package.json @@ -48,7 +48,7 @@ "@backstage/test-utils-core": "^0.1.2", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.4.2", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", diff --git a/packages/core-plugin-api/src/extensions/useElementFilter.test.tsx b/packages/core-plugin-api/src/extensions/useElementFilter.test.tsx index dc5e0046f1..4d42a0c969 100644 --- a/packages/core-plugin-api/src/extensions/useElementFilter.test.tsx +++ b/packages/core-plugin-api/src/extensions/useElementFilter.test.tsx @@ -330,7 +330,7 @@ describe('useElementFilter', () => { }, ); - expect(result.error.message).toEqual('Could not find component'); + expect(result.error?.message).toEqual('Could not find component'); }); it('should support fragments and text node iteration', () => { diff --git a/packages/version-bridge/package.json b/packages/version-bridge/package.json index 3adbac681d..0be6f0cacd 100644 --- a/packages/version-bridge/package.json +++ b/packages/version-bridge/package.json @@ -36,7 +36,7 @@ "@backstage/cli": "^0.7.11", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.4.2" + "@testing-library/react-hooks": "^7.0.2" }, "files": [ "dist" diff --git a/plugins/catalog-graph/package.json b/plugins/catalog-graph/package.json index 75f65a950b..cfd2e60755 100644 --- a/plugins/catalog-graph/package.json +++ b/plugins/catalog-graph/package.json @@ -48,7 +48,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", "@testing-library/user-event": "^13.1.8", - "@testing-library/react-hooks": "^3.4.2", + "@testing-library/react-hooks": "^7.0.2", "@types/jest": "^26.0.7" }, "files": [ diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index 091ca286d6..f0bf37a889 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -60,7 +60,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.3.0", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "cross-fetch": "^3.0.6", diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json index 156cb66de2..4a85e60641 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -52,7 +52,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.3.0", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/jwt-decode": "^3.1.0", diff --git a/plugins/git-release-manager/package.json b/plugins/git-release-manager/package.json index e396ff3f5b..11c6dd5c9d 100644 --- a/plugins/git-release-manager/package.json +++ b/plugins/git-release-manager/package.json @@ -45,7 +45,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.4.2", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", diff --git a/plugins/kafka/package.json b/plugins/kafka/package.json index c5bbfebbaf..ec275a3d4d 100644 --- a/plugins/kafka/package.json +++ b/plugins/kafka/package.json @@ -41,7 +41,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.4.2", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json index b4d1953c7d..98743b260b 100644 --- a/plugins/kubernetes/package.json +++ b/plugins/kubernetes/package.json @@ -57,7 +57,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.4.2", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index 4599a4c572..b40f53b848 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -41,7 +41,6 @@ "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", - "@testing-library/react-hooks": "^3.4.2", "react": "^16.13.1", "react-dom": "^16.13.1", "react-router-dom": "6.0.0-beta.0", @@ -54,6 +53,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", diff --git a/plugins/rollbar/package.json b/plugins/rollbar/package.json index db70d54f34..bc5bb7d5e0 100644 --- a/plugins/rollbar/package.json +++ b/plugins/rollbar/package.json @@ -55,7 +55,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.3.0", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index a322da960e..6c7211f414 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -70,7 +70,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.3.0", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/humanize-duration": "^3.18.1", "@types/jest": "^26.0.7", diff --git a/plugins/search/package.json b/plugins/search/package.json index 81a124e48a..df6864d991 100644 --- a/plugins/search/package.json +++ b/plugins/search/package.json @@ -56,7 +56,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.4.2", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index f134a5d64b..ba61934c60 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -67,7 +67,7 @@ "@backstage/test-utils": "^0.1.17", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", - "@testing-library/react-hooks": "^3.4.2", + "@testing-library/react-hooks": "^7.0.2", "@testing-library/user-event": "^13.1.8", "@types/dompurify": "^2.2.2", "@types/jest": "^26.0.7", diff --git a/plugins/techdocs/src/reader/components/useReaderState.test.tsx b/plugins/techdocs/src/reader/components/useReaderState.test.tsx index b0d4e0326a..cce8282b3d 100644 --- a/plugins/techdocs/src/reader/components/useReaderState.test.tsx +++ b/plugins/techdocs/src/reader/components/useReaderState.test.tsx @@ -359,7 +359,9 @@ describe('useReaderState', () => { contentReload: expect.any(Function), }); - await waitForValueToChange(() => result.current.state); + await waitForValueToChange(() => result.current.state, { + timeout: 2000, + }); expect(result.current).toEqual({ state: 'INITIAL_BUILD', @@ -496,7 +498,9 @@ describe('useReaderState', () => { }); // the new content is loaded - await waitForValueToChange(() => result.current.state); + await waitForValueToChange(() => result.current.state, { + timeout: 2000, + }); expect(result.current).toEqual({ state: 'CONTENT_FRESH', path: '/example', @@ -576,7 +580,9 @@ describe('useReaderState', () => { contentReload: expect.any(Function), }); - await waitForValueToChange(() => result.current.state); + await waitForValueToChange(() => result.current.state, { + timeout: 2000, + }); expect(result.current).toEqual({ state: 'CONTENT_FRESH', path: '/new', diff --git a/yarn.lock b/yarn.lock index 267829f5b4..b5e7ee52ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6342,7 +6342,7 @@ lodash "^4.17.15" redent "^3.0.0" -"@testing-library/react-hooks@^3.3.0", "@testing-library/react-hooks@^3.4.2": +"@testing-library/react-hooks@^3.4.2": version "3.4.2" resolved "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-3.4.2.tgz#8deb94f7684e0d896edd84a4c90e5b79a0810bc2" integrity sha512-RfPG0ckOzUIVeIqlOc1YztKgFW+ON8Y5xaSPbiBkfj9nMkkiLhLeBXT5icfPX65oJV/zCZu4z8EVnUc6GY9C5A== @@ -6350,6 +6350,17 @@ "@babel/runtime" "^7.5.4" "@types/testing-library__react-hooks" "^3.4.0" +"@testing-library/react-hooks@^7.0.2": + version "7.0.2" + resolved "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-7.0.2.tgz#3388d07f562d91e7f2431a4a21b5186062ecfee0" + integrity sha512-dYxpz8u9m4q1TuzfcUApqi8iFfR6R0FaMbr2hjZJy1uC8z+bO/K4v8Gs9eogGKYQop7QsrBTFkv/BCF7MzD2Cg== + dependencies: + "@babel/runtime" "^7.12.5" + "@types/react" ">=16.9.0" + "@types/react-dom" ">=16.9.0" + "@types/react-test-renderer" ">=16.9.0" + react-error-boundary "^3.1.0" + "@testing-library/react@^11.2.5": version "11.2.6" resolved "https://registry.npmjs.org/@testing-library/react/-/react-11.2.6.tgz#586a23adc63615985d85be0c903f374dab19200b" @@ -7331,7 +7342,7 @@ dependencies: "@types/react" "*" -"@types/react-dom@*": +"@types/react-dom@*", "@types/react-dom@>=16.9.0": version "17.0.9" resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.9.tgz#441a981da9d7be117042e1a6fd3dac4b30f55add" integrity sha512-wIvGxLfgpVDSAMH5utdL9Ngm5Owu0VsGmldro3ORLXV8CShrL8awVj06NuEXFQ5xyaYfdca7Sgbk/50Ri1GdPg== @@ -7374,7 +7385,7 @@ dependencies: "@types/react" "*" -"@types/react-test-renderer@*": +"@types/react-test-renderer@*", "@types/react-test-renderer@>=16.9.0": version "16.9.2" resolved "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-16.9.2.tgz#e1c408831e8183e5ad748fdece02214a7c2ab6c5" integrity sha512-4eJr1JFLIAlWhzDkBCkhrOIWOvOxcCAfQh+jiKg7l/nNZcCIL2MHl2dZhogIFKyHzedVWHaVP1Yydq/Ruu4agw== @@ -7402,7 +7413,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^16.9": +"@types/react@*", "@types/react@>=16.9.0", "@types/react@^16.9": version "16.14.15" resolved "https://registry.npmjs.org/@types/react/-/react-16.14.15.tgz#95d8fa3148050e94bcdc5751447921adbe19f9e6" integrity sha512-jOxlBV9RGZhphdeqJTCv35VZOkjY+XIEY2owwSk84BNDdDv2xS6Csj6fhi+B/q30SR9Tz8lDNt/F2Z5RF3TrRg== @@ -22978,6 +22989,13 @@ react-draggable@^4.4.3: classnames "^2.2.5" prop-types "^15.6.0" +react-error-boundary@^3.1.0: + version "3.1.3" + resolved "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-3.1.3.tgz#276bfa05de8ac17b863587c9e0647522c25e2a0b" + integrity sha512-A+F9HHy9fvt9t8SNDlonq01prnU8AmkjvGKV4kk8seB9kU3xMEO8J/PQlLVmoOIDODl5U2kufSBs4vrWIqhsAA== + dependencies: + "@babel/runtime" "^7.12.5" + react-error-overlay@^6.0.9: version "6.0.9" resolved "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a"