Skip to content

Commit

Permalink
Handle react-addons-test-utils deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
timdorr committed Apr 9, 2017
1 parent 8f4deed commit 82c20ed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"mocha": "^3.2.0",
"nyc": "^10.0.0",
"react": "^15.0.0",
"react-addons-test-utils": "^15.0.0",
"react-dom": "^15.0.0",
"redux": "^3.0.0",
"rimraf": "^2.3.4",
Expand Down
9 changes: 5 additions & 4 deletions test/components/Provider.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*eslint-disable react/prop-types*/

import expect from 'expect'
import React, { PropTypes, Component } from 'react'
import TestUtils from 'react-addons-test-utils'
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import TestUtils from 'react-dom/test-utils'
import { createStore } from 'redux'
import { Provider, connect } from '../../src/index'

Expand Down Expand Up @@ -112,7 +113,7 @@ describe('React', () => {

it('should handle subscriptions correctly when there is nested Providers', () => {
const reducer = (state = 0, action) => (action.type === 'INC' ? state + 1 : state)

const innerStore = createStore(reducer)
const innerMapStateToProps = expect.createSpy().andCall(state => ({ count: state }))
@connect(innerMapStateToProps)
Expand All @@ -125,7 +126,7 @@ describe('React', () => {
class Outer extends Component {
render() { return <Provider store={innerStore}><Inner /></Provider> }
}

TestUtils.renderIntoDocument(<Provider store={outerStore}><Outer /></Provider>)
expect(innerMapStateToProps.calls.length).toBe(1)

Expand Down
9 changes: 5 additions & 4 deletions test/components/connect.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*eslint-disable react/prop-types*/

import expect from 'expect'
import React, { createClass, Children, PropTypes, Component } from 'react'
import React, { createClass, Children, Component } from 'react'
import PropTypes from 'prop-types'
import ReactDOM from 'react-dom'
import TestUtils from 'react-addons-test-utils'
import TestUtils from 'react-dom/test-utils'
import { createStore } from 'redux'
import { connect } from '../../src/index'

Expand Down Expand Up @@ -1567,7 +1568,7 @@ describe('React', () => {
}

ImpureComponent.contextTypes = {
statefulValue: React.PropTypes.number
statefulValue: PropTypes.number
}

const decorator = connect(state => state, null, null, { pure: false })
Expand All @@ -1591,7 +1592,7 @@ describe('React', () => {
}

StatefulWrapper.childContextTypes = {
statefulValue: React.PropTypes.number
statefulValue: PropTypes.number
}

const tree = TestUtils.renderIntoDocument(
Expand Down
9 changes: 1 addition & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,7 @@ fast-levenshtein@~2.0.4:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"

fbjs@^0.8.4, fbjs@^0.8.9:
fbjs@^0.8.9:
version "0.8.12"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04"
dependencies:
Expand Down Expand Up @@ -2848,13 +2848,6 @@ rc@^1.1.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

react-addons-test-utils@^15.0.0:
version "15.5.1"
resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.5.1.tgz#e0d258cda2a122ad0dff69f838260d0c3958f5f7"
dependencies:
fbjs "^0.8.4"
object-assign "^4.1.0"

react-dom@^15.0.0:
version "15.5.3"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.5.3.tgz#2ee127ce942df55da53111ae303316e68072b5c5"
Expand Down

0 comments on commit 82c20ed

Please sign in to comment.