diff --git a/mon-entreprise/package.json b/mon-entreprise/package.json index 083215219..e1064de26 100644 --- a/mon-entreprise/package.json +++ b/mon-entreprise/package.json @@ -37,11 +37,11 @@ "@types/webpack": "^4.41.10", "@typescript-eslint/eslint-plugin": "^4.0.1", "@typescript-eslint/parser": "^4.0.1", + "@wojtekmaj/enzyme-adapter-react-17": "^0.3.1", "autoprefixer": "^9.7.6", "babel-plugin-styled-components": "^1.10.7", "copy-webpack-plugin": "^4.5.2", "cypress-plugin-tab": "^1.0.5", - "enzyme-adapter-react-16": "^1.1.1", "eslint-plugin-react": "^7.12.4", "html-webpack-plugin": "^3.2.0", "i18next-parser": "^1.0.6", diff --git a/mon-entreprise/test/componentTestSetup.js b/mon-entreprise/test/componentTestSetup.js index e54bf104e..1445d1093 100644 --- a/mon-entreprise/test/componentTestSetup.js +++ b/mon-entreprise/test/componentTestSetup.js @@ -1,6 +1,8 @@ import chai from 'chai' import Enzyme from 'enzyme' -import Adapter from 'enzyme-adapter-react-16' +// We use a fork of the React adapter because the official one doesn't support +// React 17 yet. See https://github.com/enzymejs/enzyme/issues/2429 +import Adapter from '@wojtekmaj/enzyme-adapter-react-17' import sinonChai from 'sinon-chai' chai.use(sinonChai) diff --git a/yarn.lock b/yarn.lock index c74b97dae..cd9966972 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2063,6 +2063,21 @@ "@webassemblyjs/wast-parser" "1.9.0" "@xtuc/long" "4.2.2" +"@wojtekmaj/enzyme-adapter-react-17@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@wojtekmaj/enzyme-adapter-react-17/-/enzyme-adapter-react-17-0.3.1.tgz#b69d2bfe0817e6526a86b1c120daa82d49a7b697" + integrity sha512-hlUmLze72+k2dUAV5u6mlKWDCe5TrF9yVIOGJVhmA2aeR0ai8MlfP2CcDw/55aCYY2+s/QDHcNCV681JmK8qZA== + dependencies: + enzyme-adapter-utils "^1.13.1" + enzyme-shallow-equal "^1.0.4" + has "^1.0.3" + object.assign "^4.1.0" + object.values "^1.1.1" + prop-types "^15.7.2" + react-is "^16.13.1" + react-test-renderer "^17.0.0-0" + semver "^5.7.0" + "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" @@ -10190,6 +10205,11 @@ react-i18next@^11.0.0, react-i18next@^11.4.0: "@babel/runtime" "^7.3.1" html-parse-stringify2 "2.0.1" +"react-is@^16.12.0 || ^17.0.0", react-is@^17.0.1: + version "17.0.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" + integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA== + 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.9.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -10297,6 +10317,14 @@ react-router@5.2.0: tiny-invariant "^1.0.2" tiny-warning "^1.0.0" +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@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-1.2.0.tgz#0e940c78faba0c73b9b0eba9cd3dda8dfb7e7dae" @@ -10354,6 +10382,16 @@ react-test-renderer@^16.0.0-0: react-is "^16.8.6" scheduler "^0.19.1" +react-test-renderer@^17.0.0-0: + version "17.0.1" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-17.0.1.tgz#3187e636c3063e6ae498aedf21ecf972721574c7" + integrity sha512-/dRae3mj6aObwkjCcxZPlxDFh73XZLgvwhhyON2haZGUEhiaY5EjfAdw+d/rQmlcFwdTpMXCSGVk374QbCTlrA== + dependencies: + object-assign "^4.1.1" + react-is "^17.0.1" + react-shallow-renderer "^16.13.1" + scheduler "^0.20.1" + react-transition-group@^2.2.1, react-transition-group@^2.5.0: version "2.9.0" resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.9.0.tgz#df9cdb025796211151a436c69a8f3b97b5b07c8d" @@ -11072,7 +11110,7 @@ scheduler@^0.19.1: loose-envify "^1.1.0" object-assign "^4.1.1" -scheduler@^0.20.0: +scheduler@^0.20.0, scheduler@^0.20.1: version "0.20.1" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.1.tgz#da0b907e24026b01181ecbc75efdc7f27b5a000c" integrity sha512-LKTe+2xNJBNxu/QhHvDR14wUXHRQbVY5ZOYpOGWRzhydZUqrLb2JBvLPY7cAqFmqrWuDED0Mjk7013SZiOz6Bw==