Skip to content

Commit

Permalink
chore: Update react-redux and add Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Aug 19, 2020
1 parent b5ca8d4 commit f45fd89
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 31 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"cozy-jobs-cli": "1.13.6",
"cozy-scripts": "1.13.2",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.2",
"enzyme-adapter-react-16": "1.15.3",
"enzyme-to-json": "3.5.0",
"eslint-config-cozy-app": "1.1.9",
"eslint-config-prettier": "6.11.0",
Expand All @@ -51,7 +51,8 @@
"jest-environment-jsdom-sixteen": "1.0.3",
"mockdate": "3.0.2",
"pretty-quick": "1.11.1",
"react-dom": "16.13.0",
"react-dom": "16.13.1",
"react-redux-test": "npm:react-redux@5.1.1",
"replace": "1.2.0",
"stylint": "2.0.0"
},
Expand All @@ -60,7 +61,7 @@
"@testing-library/react": "10.4.3",
"classnames": "2.2.6",
"cozy-bar": "7.9.0",
"cozy-client": "13.20.0",
"cozy-client": "13.20.2",
"cozy-doctypes": "1.72.2",
"cozy-flags": "1.10.0",
"cozy-logger": "1.6.0",
Expand All @@ -74,7 +75,7 @@
"react-final-form": "3.6.7",
"react-final-form-arrays": "1.1.0",
"react-hot-loader": "4.12.20",
"react-redux": "5.1.1",
"react-redux": "7.2.1",
"redux": "4.0.4",
"redux-logger": "3.0.6",
"redux-thunk": "2.3.0",
Expand Down
8 changes: 6 additions & 2 deletions src/components/Selection/selection.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ import PropTypes from 'prop-types'
import { shallow } from 'enzyme'
import selectionContainer from './selectionContainer'
import AppLike from '../../tests/Applike'
const DummyComponent = ({ title = '' }) => <span title={title} />
const DummyComponentWithSelection = selectionContainer(DummyComponent)
import configureStore from '../../store/configureStore'
import getCozyClient from '../../tests/client'

const DummyComponent = ({ title = '' }) => <span title={title} />
DummyComponent.propTypes = {
title: PropTypes.string
}
const DummyComponentWithSelection = selectionContainer(DummyComponent)

// Uses a different version of react-redux
// to prevent Enzyme's incompatibility with actual react-redux version
jest.mock('react-redux', () => require('react-redux-test'))

describe('A component with selection', () => {
let testedComponent
Expand Down
17 changes: 10 additions & 7 deletions src/targets/browser/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'styles'

import React from 'react'
import CozyClient, { CozyProvider } from 'cozy-client'
import { Provider } from 'react-redux'
import { render } from 'react-dom'
import { I18n, initTranslation } from 'cozy-ui/transpiled/react/I18n'
import App from 'components/App'
Expand All @@ -14,13 +15,15 @@ import manifest from '../../../manifest.webapp'
import MuiCozyTheme from 'cozy-ui/transpiled/react/MuiCozyTheme'

const RootApp = props => (
<CozyProvider client={props.client} store={props.store}>
<I18n lang={props.lang} polyglot={props.polyglot}>
<MuiCozyTheme>
<HotedApp />
</MuiCozyTheme>
</I18n>
</CozyProvider>
<Provider store={props.store}>
<CozyProvider client={props.client} store={props.store}>
<I18n lang={props.lang} polyglot={props.polyglot}>
<MuiCozyTheme>
<HotedApp />
</MuiCozyTheme>
</I18n>
</CozyProvider>
</Provider>
)

const HotedApp = hot(module)(App)
Expand Down
67 changes: 49 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3698,7 +3698,29 @@ cozy-client@13.15.0:
sift "^6.0.0"
url-search-params-polyfill "^7.0.0"

cozy-client@13.20.0, cozy-client@^13.13.0, cozy-client@^13.6.0:
cozy-client@13.20.2:
version "13.20.2"
resolved "https://registry.yarnpkg.com/cozy-client/-/cozy-client-13.20.2.tgz#1fd1e813815450fda1eee757f7999f6b8d2ae00c"
integrity sha512-FdrwNTykWnHuhfcwmgo7cQYRE4mWHJU0knrR18Wnvs3jRDbzw49FQURQJIPT6lNe+Y49+q8c2DEO6vCWnzQPCA==
dependencies:
btoa "^1.2.1"
cozy-device-helper "^1.7.3"
cozy-logger "^1.6.0"
cozy-stack-client "^13.20.2"
isomorphic-fetch "^2.2.1"
lodash "^4.17.13"
microee "^0.0.6"
minilog "https://github.com/cozy/minilog.git#master"
open "^7.0.2"
prop-types "^15.6.2"
react-redux "^7.2.0"
redux "^3.7.2"
redux-thunk "^2.3.0"
server-destroy "^1.0.1"
sift "^6.0.0"
url-search-params-polyfill "^7.0.0"

cozy-client@^13.13.0, cozy-client@^13.6.0:
version "13.20.0"
resolved "https://registry.yarnpkg.com/cozy-client/-/cozy-client-13.20.0.tgz#307849253ed577e04e4271f2e45812765bb5e72e"
integrity sha512-uaIqis28V9PN7mHIL3Byqc5WuKW0957jPmyCvAHwXC9t6ydCclswOnNcIuhvXZ1HxTIpUjc7AU041eh1eqjrSw==
Expand Down Expand Up @@ -3910,6 +3932,15 @@ cozy-stack-client@^13.12.1, cozy-stack-client@^13.16.0:
mime "^2.4.0"
qs "^6.7.0"

cozy-stack-client@^13.20.2:
version "13.20.2"
resolved "https://registry.yarnpkg.com/cozy-stack-client/-/cozy-stack-client-13.20.2.tgz#2ff55f93dca809b7ec82ec0afc88a3bc041383c1"
integrity sha512-9j52p+0/kw5CAO42hPCqjV1ESwU/My79bfjF96wZRrGMFAciL+gGQy4wVeTpPlYvWIGIIbchFrUl8rQVkMVWYA==
dependencies:
detect-node "^2.0.4"
mime "^2.4.0"
qs "^6.7.0"

cozy-ui@22.3.1:
version "22.3.1"
resolved "https://registry.yarnpkg.com/cozy-ui/-/cozy-ui-22.3.1.tgz#9bd22099255e88ab2a9694a8b18d21cde3f627f5"
Expand Down Expand Up @@ -4936,22 +4967,22 @@ entities@^2.0.0:
resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f"
integrity sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==

enzyme-adapter-react-16@1.15.2:
version "1.15.2"
resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.2.tgz#b16db2f0ea424d58a808f9df86ab6212895a4501"
integrity sha512-SkvDrb8xU3lSxID8Qic9rB8pvevDbLybxPK6D/vW7PrT0s2Cl/zJYuXvsd1EBTz0q4o3iqG3FJhpYz3nUNpM2Q==
enzyme-adapter-react-16@1.15.3:
version "1.15.3"
resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.3.tgz#90154055be3318d70a51df61ac89cfa22e3d5f60"
integrity sha512-98rqNI4n9HZslWIPuuwy4hK1bxRuMy+XX0CU1dS8iUqcgisTxeBaap6oPp2r4MWC8OphCbbqAT8EU/xHz3zIaQ==
dependencies:
enzyme-adapter-utils "^1.13.0"
enzyme-shallow-equal "^1.0.1"
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.12.0"
react-is "^16.13.1"
react-test-renderer "^16.0.0-0"
semver "^5.7.0"

enzyme-adapter-utils@^1.13.0:
enzyme-adapter-utils@^1.13.1:
version "1.13.1"
resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.13.1.tgz#59c1b734b0927543e3d8dc477299ec957feb312d"
integrity sha512-5A9MXXgmh/Tkvee3bL/9RCAAgleHqFnsurTYCbymecO4ohvtNO5zqIhHxV370t7nJAwaCfkgtffarKpC0GPt0g==
Expand All @@ -4963,7 +4994,7 @@ enzyme-adapter-utils@^1.13.0:
prop-types "^15.7.2"
semver "^5.7.1"

enzyme-shallow-equal@^1.0.1:
enzyme-shallow-equal@^1.0.1, enzyme-shallow-equal@^1.0.4:
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==
Expand Down Expand Up @@ -11352,15 +11383,15 @@ react-autowhatever@^10.1.2:
react-themeable "^1.1.0"
section-iterator "^2.0.0"

react-dom@16.13.0:
version "16.13.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.0.tgz#cdde54b48eb9e8a0ca1b3dc9943d9bb409b81866"
integrity sha512-y09d2c4cG220DzdlFkPTnVvGTszVvNpC73v+AaLGLHbkpy3SSgvYq8x0rNwPJ/Rk/CicTNgk0hbHNw1gMEZAXg==
react-dom@16.13.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f"
integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.19.0"
scheduler "^0.19.1"

react-dom@16.8.1:
version "16.8.1"
Expand Down Expand Up @@ -11464,7 +11495,7 @@ react-pdf@^4.0.5:
pdfjs-dist "2.1.266"
prop-types "^15.6.2"

react-redux@5.1.1:
"react-redux-test@npm:react-redux@5.1.1", react-redux@5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-5.1.1.tgz#88e368682c7fa80e34e055cd7ac56f5936b0f52f"
integrity sha512-LE7Ned+cv5qe7tMV5BPYkGQ5Lpg8gzgItK07c67yHvJ8t0iaD9kPFPAli/mYkiyJYrs2pJgExR2ZgsGqlrOApg==
Expand All @@ -11477,7 +11508,7 @@ react-redux@5.1.1:
react-is "^16.6.0"
react-lifecycles-compat "^3.0.0"

react-redux@^7.2.0:
react-redux@7.2.1, react-redux@^7.2.0:
version "7.2.1"
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.1.tgz#8dedf784901014db2feca1ab633864dee68ad985"
integrity sha512-T+VfD/bvgGTUA74iW9d2i5THrDQWbweXP0AVNI8tNd1Rk5ch1rnMiJkDD67ejw7YBKM4+REvcvqRuWJb7BLuEg==
Expand Down Expand Up @@ -12179,7 +12210,7 @@ saxes@^5.0.0:
dependencies:
xmlchars "^2.2.0"

scheduler@0.18.0, scheduler@^0.13.1, scheduler@^0.19.0, scheduler@^0.19.1:
scheduler@0.18.0, scheduler@^0.13.1, scheduler@^0.19.1:
version "0.18.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.18.0.tgz#5901ad6659bc1d8f3fdaf36eb7a67b0d6746b1c4"
integrity sha512-agTSHR1Nbfi6ulI0kYNK0203joW2Y5W4po4l+v03tOoiJKpTBbxpNhWDvqc/4IcOw+KLmSiQLTasZ4cab2/UWQ==
Expand Down

0 comments on commit f45fd89

Please sign in to comment.