diff --git a/package.json b/package.json index 8f509d8..6c4124b 100644 --- a/package.json +++ b/package.json @@ -158,6 +158,7 @@ "react-dom": "^16.3.0", "react-ga": "^2.4.1", "react-i18next": "^7.3.6", + "react-test-renderer": "^16.3.0", "style-loader": "^0.20.1", "svg-react-loader": "^0.4.5", "uglifyjs-webpack-plugin": "^1.1.8", diff --git a/src/components/Form/test.js b/src/components/Form/test.js index b8f4835..e917f66 100644 --- a/src/components/Form/test.js +++ b/src/components/Form/test.js @@ -60,14 +60,11 @@ describe('Form', () => { expect(component.state('syntax')).toEqual('Testing value'); }); - // Disabled due to testing with getDerivedStateFromProps appears to be broken - // Testing this behavior in browser works correctly - xtest('setting expression and syntax via props', () => { + test('setting expression and syntax via props', () => { const component = shallow(
); expect(component.state()).toEqual(expect.objectContaining({ - expr: undefined, syntax: 'js' })); component.setProps({ expr: 'Testing expression' }); diff --git a/yarn.lock b/yarn.lock index 2affd38..0663fc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7386,6 +7386,10 @@ react-i18next@^7.3.6: html-parse-stringify2 "2.0.1" prop-types "^15.6.0" +react-is@^16.3.0: + version "16.3.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.3.0.tgz#f0e8bfd8c09b480dd610b8639d9ed65c13601224" + react-reconciler@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.7.0.tgz#9614894103e5f138deeeb5eabaf3ee80eb1d026d" @@ -7395,13 +7399,14 @@ react-reconciler@^0.7.0: object-assign "^4.1.1" prop-types "^15.6.0" -react-test-renderer@^16.0.0-0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.2.0.tgz#bddf259a6b8fcd8555f012afc8eacc238872a211" +react-test-renderer@^16.0.0-0, react-test-renderer@^16.3.0: + version "16.3.0" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.3.0.tgz#7e88d8cb4c2b95c161b6c6c998991166f74d473e" dependencies: fbjs "^0.8.16" object-assign "^4.1.1" prop-types "^15.6.0" + react-is "^16.3.0" "react@^15.6.2 || ^16.0": version "16.2.0"