From 6d62f57011d1aa0bfcd73e0ad5a5c4c60cc77ebb Mon Sep 17 00:00:00 2001 From: Antonio Gamez Diaz Date: Thu, 9 Sep 2021 12:35:52 +0200 Subject: [PATCH 1/2] Update to React 17 Signed-off-by: Antonio Gamez Diaz --- dashboard/package.json | 8 +- .../hooks/useOutsideClick/useOutsideClick.js | 2 +- .../useOutsideClick/useOutsideClick.test.js | 6 +- dashboard/src/setupTests.ts | 7 +- dashboard/yarn.lock | 163 +++++++++--------- 5 files changed, 90 insertions(+), 96 deletions(-) diff --git a/dashboard/package.json b/dashboard/package.json index 9c94515dea0..294adca7bf9 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -13,7 +13,6 @@ "ajv": "^8.6.2", "axios": "^0.21.4", "connected-react-router": "^6.9.1", - "enzyme-adapter-react-16": "^1.15.6", "fast-json-patch": "^3.1.0", "fstream": "^1.0.12", "google-protobuf": "^3.17.3", @@ -28,12 +27,12 @@ "protobufjs": "^6.11.2", "qs": "^6.10.1", "raf": "^3.4.1", - "react": "^16.14.0", + "react": "^17.0.2", "react-ace": "^9.4.3", "react-compound-slider": "^3.3.1", "react-copy-to-clipboard": "^5.0.4", "react-diff-viewer": "^3.1.1", - "react-dom": "^16.14.0", + "react-dom": "^17.0.2", "react-helmet": "^6.1.0", "react-intl": "^5.20.10", "react-jsonschema-form": "^1.8.1", @@ -44,7 +43,7 @@ "react-router-hash-link": "^2.4.3", "react-switch": "^6.0.0", "react-tabs": "^3.2.2", - "react-test-renderer": "^16.14.0", + "react-test-renderer": "^17.0.2", "react-tooltip": "^4.2.21", "react-transition-group": "^4.4.2", "redux": "^4.1.1", @@ -114,6 +113,7 @@ "@types/react-transition-group": "^4.4.2", "@types/redux-mock-store": "^1.0.3", "@types/swagger-ui-react": "^3.35.2", + "@wojtekmaj/enzyme-adapter-react-17": "^0.6.3", "enzyme": "^3.11.0", "eslint-config-prettier": "^8.3.0", "eslint-import-resolver-typescript": "^2.4.0", diff --git a/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.js b/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.js index 60d47e8af00..137f2ce00bc 100644 --- a/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.js +++ b/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.js @@ -25,7 +25,7 @@ const useOutsideClick = (callback, refs, enabled = true) => { useEffect(() => { if (enabled) { - document.addEventListener("mousedown", memoizeClick); + document.addEventListener("mousedown", memoizeClick, { capture: true }); } return () => document.removeEventListener("mousedown", memoizeClick); }, [memoizeClick, enabled]); diff --git a/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.test.js b/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.test.js index 87d46171442..37aaad8774b 100644 --- a/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.test.js +++ b/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.test.js @@ -32,10 +32,10 @@ describe(useOutsideClick, () => { const listeners = {}; document.addEventListener = jest.fn((event, cb) => { listeners[event] = cb; - }); + }, { capture: true }); mount(); - expect(Object.keys(listeners).length).toBe(1); + expect(Object.keys(listeners).length).toBe(2); expect(listeners["mousedown"]).toBeDefined(); }); @@ -44,7 +44,7 @@ describe(useOutsideClick, () => { const listeners = {}; document.addEventListener = jest.fn((event, cb) => { listeners[event] = cb; - }); + }, { capture: true }); const wrapper = mount(); expect(Object.keys(listeners).length).toBe(0); diff --git a/dashboard/src/setupTests.ts b/dashboard/src/setupTests.ts index 1f18e78296f..9a8938026d1 100644 --- a/dashboard/src/setupTests.ts +++ b/dashboard/src/setupTests.ts @@ -1,10 +1,11 @@ -import { configure } from "enzyme"; -import Adapter from "enzyme-adapter-react-16"; +import Enzyme from "enzyme"; +import Adapter from "@wojtekmaj/enzyme-adapter-react-17"; + import "jest-enzyme"; import { WebSocket } from "mock-socket"; import "raf/polyfill"; // polyfill for requestAnimationFrame -configure({ adapter: new Adapter() }); +Enzyme.configure({ adapter: new Adapter() }); // Mock browser specific APIs like localstorage or Websocket jest.spyOn(window.localStorage.__proto__, "clear"); diff --git a/dashboard/yarn.lock b/dashboard/yarn.lock index b73edc8978b..19b721568d3 100644 --- a/dashboard/yarn.lock +++ b/dashboard/yarn.lock @@ -2867,6 +2867,31 @@ "@webassemblyjs/wast-parser" "1.9.0" "@xtuc/long" "4.2.2" +"@wojtekmaj/enzyme-adapter-react-17@^0.6.3": + version "0.6.3" + resolved "https://registry.yarnpkg.com/@wojtekmaj/enzyme-adapter-react-17/-/enzyme-adapter-react-17-0.6.3.tgz#bf7cd6007d99996bd7d98c843644b213a3ecc74e" + integrity sha512-Kp1ZJxtHkKEnUksaWrcMABNTOgL4wOt8VI6k2xOek2aH9PtZcWRXJNUEgnKrdJrqg5UqIjRslbVF9uUqwQJtFg== + dependencies: + "@wojtekmaj/enzyme-adapter-utils" "^0.1.1" + enzyme-shallow-equal "^1.0.0" + has "^1.0.0" + object.assign "^4.1.0" + object.values "^1.1.0" + prop-types "^15.7.0" + react-is "^17.0.2" + react-test-renderer "^17.0.0" + +"@wojtekmaj/enzyme-adapter-utils@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@wojtekmaj/enzyme-adapter-utils/-/enzyme-adapter-utils-0.1.1.tgz#17773cf264570fbcfc0d33bb74e4002c17f2f1ec" + integrity sha512-bNPWtN/d8huKOkC6j1E3EkSamnRrHHT7YuR6f9JppAQqtoAm3v4/vERe4J14jQKmHLCyEBHXrlgb7H6l817hVg== + dependencies: + function.prototype.name "^1.1.0" + has "^1.0.0" + object.assign "^4.1.0" + object.fromentries "^2.0.0" + prop-types "^15.7.0" + "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" @@ -2974,21 +2999,6 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -airbnb-prop-types@^2.16.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.16.0.tgz#b96274cefa1abb14f623f804173ee97c13971dc2" - integrity sha512-7WHOFolP/6cS96PhKNrslCLMYAI8yB1Pp6u6XmxozQOiZbsI5ycglZr5cHhBFfuRcQQjzCMith5ZPZdYiJCxUg== - dependencies: - array.prototype.find "^2.1.1" - function.prototype.name "^1.1.2" - is-regex "^1.1.0" - object-is "^1.1.2" - object.assign "^4.1.0" - object.entries "^1.1.2" - prop-types "^15.7.2" - prop-types-exact "^1.2.0" - react-is "^16.13.1" - ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" @@ -3205,14 +3215,6 @@ array.prototype.filter@^1.0.0: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.5" -array.prototype.find@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.1.tgz#3baca26108ca7affb08db06bf0be6cb3115a969c" - integrity sha512-mi+MYNJYLTx2eNYy+Yh6raoQacCsNeeMUaspFPh9Y141lFSsWxxB8V9mM2ye+eqiRs917J6/pJ4M9ZPzenWckA== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.4" - array.prototype.flat@^1.2.3, array.prototype.flat@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" @@ -5562,34 +5564,6 @@ entities@^2.0.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== -enzyme-adapter-react-16@^1.15.6: - version "1.15.6" - resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.6.tgz#fd677a658d62661ac5afd7f7f541f141f8085901" - integrity sha512-yFlVJCXh8T+mcQo8M6my9sPgeGzj85HSHi6Apgf1Cvq/7EL/J9+1JoJmJsRxZgyTvPMAqOEpRSu/Ii/ZpyOk0g== - dependencies: - enzyme-adapter-utils "^1.14.0" - enzyme-shallow-equal "^1.0.4" - has "^1.0.3" - object.assign "^4.1.2" - object.values "^1.1.2" - prop-types "^15.7.2" - react-is "^16.13.1" - react-test-renderer "^16.0.0-0" - semver "^5.7.0" - -enzyme-adapter-utils@^1.14.0: - version "1.14.0" - resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.14.0.tgz#afbb0485e8033aa50c744efb5f5711e64fbf1ad0" - integrity sha512-F/z/7SeLt+reKFcb7597IThpDp0bmzcH1E9Oabqv+o01cID2/YInlqHbFl7HzWBl4h3OdZYedtwNDOmSKkk0bg== - dependencies: - airbnb-prop-types "^2.16.0" - function.prototype.name "^1.1.3" - has "^1.0.3" - object.assign "^4.1.2" - object.fromentries "^2.0.3" - prop-types "^15.7.2" - semver "^5.7.1" - enzyme-matchers@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/enzyme-matchers/-/enzyme-matchers-7.1.2.tgz#d80530a61f22d28bb993dd7588abba38bd4de282" @@ -5598,7 +5572,7 @@ enzyme-matchers@^7.1.2: circular-json-es6 "^2.0.1" deep-equal-ident "^1.1.1" -enzyme-shallow-equal@^1.0.1, enzyme-shallow-equal@^1.0.4: +enzyme-shallow-equal@^1.0.0, enzyme-shallow-equal@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.4.tgz#b9256cb25a5f430f9bfe073a84808c1d74fced2e" integrity sha512-MttIwB8kKxypwHvRynuC3ahyNc+cFbR8mjVIltnmzQ0uKGqmsfO4bfBuLxb0beLNPhjblUEYvEbsg+VSygvF1Q== @@ -5664,7 +5638,7 @@ error-stack-parser@^2.0.6: dependencies: stackframe "^1.1.1" -es-abstract@^1.17.2, es-abstract@^1.17.4, es-abstract@^1.18.0, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: +es-abstract@^1.17.2, es-abstract@^1.18.0, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2, es-abstract@^1.18.2: version "1.18.5" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.5.tgz#9b10de7d4c206a3581fd5b2124233e04db49ae19" integrity sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA== @@ -6689,7 +6663,7 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -function.prototype.name@^1.1.2, function.prototype.name@^1.1.3: +function.prototype.name@^1.1.0, function.prototype.name@^1.1.2: version "1.1.4" resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.4.tgz#e4ea839b9d3672ae99d0efd9f38d9191c5eaac83" integrity sha512-iqy1pIotY/RmhdFZygSSlW0wko2yxkSCKqsuv4pr8QESohpYyG/Z7B/XXvPRKTJS//960rgguE5mSRUsDdaJrQ== @@ -7913,7 +7887,7 @@ is-promise@^2.2.2: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== -is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.0, is-regex@^1.1.3: +is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== @@ -10553,7 +10527,7 @@ object.assign@^4.1.0, object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" -object.entries@^1.1.0, object.entries@^1.1.1, object.entries@^1.1.2, object.entries@^1.1.4: +object.entries@^1.1.0, object.entries@^1.1.1, object.entries@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.4.tgz#43ccf9a50bc5fd5b649d45ab1a579f24e088cafd" integrity sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA== @@ -10562,7 +10536,7 @@ object.entries@^1.1.0, object.entries@^1.1.1, object.entries@^1.1.2, object.entr define-properties "^1.1.3" es-abstract "^1.18.2" -object.fromentries@^2.0.3, object.fromentries@^2.0.4: +object.fromentries@^2.0.0, object.fromentries@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.4.tgz#26e1ba5c4571c5c6f0890cef4473066456a120b8" integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ== @@ -10588,7 +10562,7 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -object.values@^1.1.0, object.values@^1.1.1, object.values@^1.1.2, object.values@^1.1.4: +object.values@^1.1.0, object.values@^1.1.1, object.values@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.4.tgz#0d273762833e816b693a637d30073e7051535b30" integrity sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg== @@ -11965,16 +11939,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types-exact@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869" - integrity sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA== - dependencies: - has "^1.0.3" - object.assign "^4.1.0" - reflect.ownkeys "^0.2.0" - -prop-types@^15.0.0, prop-types@^15.5.0, prop-types@^15.5.8, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@^15.0.0, prop-types@^15.5.0, prop-types@^15.5.8, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.0, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -12302,7 +12267,7 @@ react-diff-viewer@^3.1.1: memoize-one "^5.0.4" prop-types "^15.6.2" -react-dom@^16.13.1, react-dom@^16.14.0: +react-dom@^16.13.1: version "16.14.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.14.0.tgz#7ad838ec29a777fb3c75c3a190f661cf92ab8b89" integrity sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw== @@ -12312,6 +12277,15 @@ react-dom@^16.13.1, react-dom@^16.14.0: prop-types "^15.6.2" scheduler "^0.19.1" +react-dom@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" + integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + scheduler "^0.20.2" + react-error-overlay@^6.0.9: version "6.0.9" resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a" @@ -12369,12 +12343,12 @@ react-intl@^5.20.10: intl-messageformat "9.9.1" tslib "^2.1.0" -react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6: +react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-is@^17.0.0, react-is@^17.0.1: +"react-is@^16.12.0 || ^17.0.0", react-is@^17.0.0, react-is@^17.0.1, react-is@^17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== @@ -12562,6 +12536,14 @@ react-scripts@^4.0.3: optionalDependencies: fsevents "^2.1.3" +react-shallow-renderer@^16.13.1: + version "16.14.1" + resolved "https://registry.yarnpkg.com/react-shallow-renderer/-/react-shallow-renderer-16.14.1.tgz#bf0d02df8a519a558fd9b8215442efa5c840e124" + integrity sha512-rkIMcQi01/+kxiTE9D3fdS959U1g7gs+/rborw++42m1O9FAQiNI/UNRZExVUoAOprn4umcXf+pFRou8i4zuBg== + dependencies: + object-assign "^4.1.1" + react-is "^16.12.0 || ^17.0.0" + react-side-effect@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.1.tgz#66c5701c3e7560ab4822a4ee2742dee215d72eb3" @@ -12593,15 +12575,15 @@ react-tabs@^3.2.2: clsx "^1.1.0" prop-types "^15.5.0" -react-test-renderer@^16.0.0-0, react-test-renderer@^16.14.0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.14.0.tgz#e98360087348e260c56d4fe2315e970480c228ae" - integrity sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg== +react-test-renderer@^17.0.0, react-test-renderer@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-17.0.2.tgz#4cd4ae5ef1ad5670fc0ef776e8cc7e1231d9866c" + integrity sha512-yaQ9cB89c17PUb0x6UfWRs7kQCorVdHlutU1boVPEsB8IDZH6n9tHxMacc3y0JoXOJUsZb/t/Mb8FUWMKaM7iQ== dependencies: object-assign "^4.1.1" - prop-types "^15.6.2" - react-is "^16.8.6" - scheduler "^0.19.1" + react-is "^17.0.2" + react-shallow-renderer "^16.13.1" + scheduler "^0.20.2" react-tooltip@^4.2.21: version "4.2.21" @@ -12621,7 +12603,7 @@ react-transition-group@^4.4.2: loose-envify "^1.4.0" prop-types "^15.6.2" -react@^16.13.1, react@^16.14.0: +react@^16.13.1: version "16.14.0" resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d" integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g== @@ -12630,6 +12612,14 @@ react@^16.13.1, react@^16.14.0: object-assign "^4.1.1" prop-types "^15.6.2" +react@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + read-pkg-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" @@ -12782,11 +12772,6 @@ redux@^4.0.0, redux@^4.0.5, redux@^4.1.1: dependencies: "@babel/runtime" "^7.9.2" -reflect.ownkeys@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460" - integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA= - refractor@^3.2.0: version "3.4.0" resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.4.0.tgz#62bd274b06c942041f390c371b676eb67cb0a678" @@ -13329,6 +13314,14 @@ scheduler@^0.19.1: loose-envify "^1.1.0" object-assign "^4.1.1" +scheduler@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" + integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + schema-utils@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" @@ -13383,7 +13376,7 @@ semver-regex@^3.1.2: resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807" integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA== -"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: +"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== From 9267ef4292d8cddfb0d612d19d24efbbc10cc9c5 Mon Sep 17 00:00:00 2001 From: Antonio Gamez Diaz Date: Thu, 9 Sep 2021 19:47:03 +0200 Subject: [PATCH 2/2] Run prettier Signed-off-by: Antonio Gamez Diaz --- .../useOutsideClick/useOutsideClick.test.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.test.js b/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.test.js index 37aaad8774b..ed547d1a550 100644 --- a/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.test.js +++ b/dashboard/src/components/js/hooks/useOutsideClick/useOutsideClick.test.js @@ -30,9 +30,12 @@ describe(useOutsideClick, () => { it("should attach the event to the global event listener", () => { // Mock addEventListener const listeners = {}; - document.addEventListener = jest.fn((event, cb) => { - listeners[event] = cb; - }, { capture: true }); + document.addEventListener = jest.fn( + (event, cb) => { + listeners[event] = cb; + }, + { capture: true }, + ); mount(); expect(Object.keys(listeners).length).toBe(2); @@ -42,9 +45,12 @@ describe(useOutsideClick, () => { it("should attach the event only when enabled is true", async () => { // Mock addEventListener const listeners = {}; - document.addEventListener = jest.fn((event, cb) => { - listeners[event] = cb; - }, { capture: true }); + document.addEventListener = jest.fn( + (event, cb) => { + listeners[event] = cb; + }, + { capture: true }, + ); const wrapper = mount(); expect(Object.keys(listeners).length).toBe(0);