Skip to content

Commit 33063ed

Browse files
committed
Merge pull request #2190 from rackt/update-react
update react to v0.14.0
2 parents 5d46af0 + 0e9fb90 commit 33063ed

13 files changed

+85
-70
lines changed

modules/__tests__/History-test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*eslint-env mocha */
22
import expect from 'expect'
33
import React from 'react'
4+
import { render, unmountComponentAtNode } from 'react-dom'
45
import History from '../History'
56
import Router from '../Router'
67
import Route from '../Route'
@@ -14,7 +15,7 @@ describe('History Mixin', function () {
1415
})
1516

1617
afterEach(function () {
17-
React.unmountComponentAtNode(node)
18+
unmountComponentAtNode(node)
1819
})
1920

2021
it('assigns the history to the component instance', function (done) {
@@ -30,7 +31,7 @@ describe('History Mixin', function () {
3031
render() { return null }
3132
})
3233

33-
React.render((
34+
render((
3435
<Router history={history}>
3536
<Route path="/" component={Component} />
3637
</Router>

modules/__tests__/IndexLink-test.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*eslint react/prop-types: 0*/
33
import expect from 'expect'
44
import React from 'react'
5+
import { render, unmountComponentAtNode } from 'react-dom'
56
import createHistory from 'history/lib/createMemoryHistory'
67
import IndexRoute from '../IndexRoute'
78
import IndexLink from '../IndexLink'
@@ -73,7 +74,7 @@ describe('An <IndexLink>', function () {
7374
<Route path="contact" component={WebsiteContact} />
7475
<IndexRoute component={WebsiteOverview} />
7576
</Route>
76-
</Route>
77+
</Route>
7778
)
7879

7980
let node
@@ -82,12 +83,12 @@ describe('An <IndexLink>', function () {
8283
})
8384

8485
afterEach(function () {
85-
React.unmountComponentAtNode(node)
86+
unmountComponentAtNode(node)
8687
})
8788

8889
describe('when linking to the overview', function () {
8990
it('is active and other routes are not', function (done) {
90-
React.render((
91+
render((
9192
<Router history={createHistory('/website')} routes={routes} />
9293
), node, function () {
9394
expect(node.querySelector('#overviewLink').className).toEqual('active')
@@ -101,7 +102,7 @@ describe('An <IndexLink>', function () {
101102

102103
describe('when linking to the contact', function () {
103104
it('is active and other routes are not', function (done) {
104-
React.render((
105+
render((
105106
<Router history={createHistory('/website/contact')} routes={routes} />
106107
), node, function () {
107108
expect(node.querySelector('#overviewLink').className).toEqual('')
@@ -115,7 +116,7 @@ describe('An <IndexLink>', function () {
115116

116117
describe('when linking to the products', function () {
117118
it('is active and other routes are not', function (done) {
118-
React.render((
119+
render((
119120
<Router history={createHistory('/website/products')} routes={routes} />
120121
), node, function () {
121122
expect(node.querySelector('#overviewLink').className).toEqual('')
@@ -129,7 +130,7 @@ describe('An <IndexLink>', function () {
129130

130131
describe('when linking to a specific product', function () {
131132
it("is active and it's parent is also active", function (done) {
132-
React.render((
133+
render((
133134
<Router history={createHistory('/website/products/15')} routes={routes} />
134135
), node, function () {
135136
expect(node.querySelector('#overviewLink').className).toEqual('')

modules/__tests__/IndexRedirect-test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*eslint-env mocha */
22
import expect from 'expect'
33
import React from 'react'
4+
import { render, unmountComponentAtNode } from 'react-dom'
45
import createHistory from 'history/lib/createMemoryHistory'
56
import IndexRedirect from '../IndexRedirect'
67
import Router from '../Router'
@@ -14,11 +15,11 @@ describe('An <IndexRedirect>', function () {
1415
})
1516

1617
afterEach(function () {
17-
React.unmountComponentAtNode(node)
18+
unmountComponentAtNode(node)
1819
})
1920

2021
it('works', function (done) {
21-
React.render((
22+
render((
2223
<Router history={createHistory('/')}>
2324
<Route path="/">
2425
<IndexRedirect to="/messages" />

modules/__tests__/IndexRoute-test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*eslint react/prop-types: 0*/
33
import expect from 'expect'
44
import React from 'react'
5+
import { render, unmountComponentAtNode } from 'react-dom'
56
import createHistory from 'history/lib/createMemoryHistory'
67
import IndexRoute from '../IndexRoute'
78
import Router from '../Router'
@@ -27,11 +28,11 @@ describe('An <IndexRoute>', function () {
2728
})
2829

2930
afterEach(function () {
30-
React.unmountComponentAtNode(node)
31+
unmountComponentAtNode(node)
3132
})
3233

3334
it('renders when its parent’s url matches exactly', function (done) {
34-
React.render((
35+
render((
3536
<Router history={createHistory('/')}>
3637
<Route path="/" component={Parent}>
3738
<IndexRoute component={Child}/>
@@ -45,7 +46,7 @@ describe('An <IndexRoute>', function () {
4546

4647
describe('nested deeply in the route hierarchy', function () {
4748
it('renders when its parent’s url matches exactly', function (done) {
48-
React.render((
49+
render((
4950
<Router history={createHistory('/test')}>
5051
<Route path="/" component={Parent}>
5152
<IndexRoute component={Child}/>

modules/__tests__/Link-test.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
/*eslint react/prop-types: 0*/
33
import assert from 'assert'
44
import expect from 'expect'
5-
import React from 'react/addons'
5+
import React from 'react'
6+
import ReactTestUtils from 'react-addons-test-utils'
7+
import { render } from 'react-dom'
68
import createHistory from 'history/lib/createMemoryHistory'
79
import execSteps from './execSteps'
810
import Router from '../Router'
911
import Route from '../Route'
1012
import Link from '../Link'
1113

12-
const { click } = React.addons.TestUtils.Simulate
14+
const { click } = ReactTestUtils.Simulate
1315

1416
describe('A <Link>', function () {
1517

@@ -37,7 +39,7 @@ describe('A <Link>', function () {
3739
}
3840
}
3941

40-
React.render((
42+
render((
4143
<Router history={createHistory('/')}>
4244
<Route path="/" component={LinkWrapper} />
4345
</Router>
@@ -79,7 +81,7 @@ describe('A <Link>', function () {
7981
}
8082

8183
it('is active when its params match', function (done) {
82-
React.render((
84+
render((
8385
<Router history={createHistory('/hello/michael')}>
8486
<Route path="/" component={App}>
8587
<Route path="hello/:name" component={Hello} />
@@ -93,7 +95,7 @@ describe('A <Link>', function () {
9395
})
9496

9597
it('is not active when its params do not match', function (done) {
96-
React.render((
98+
render((
9799
<Router history={createHistory('/hello/michael')}>
98100
<Route path="/" component={App}>
99101
<Route path="hello/:name" component={Hello} />
@@ -134,7 +136,7 @@ describe('A <Link>', function () {
134136

135137
const execNextStep = execSteps(steps, done)
136138

137-
React.render((
139+
render((
138140
<Router history={createHistory('/goodbye')} onUpdate={execNextStep}>
139141
<Route path="/" component={LinkWrapper}>
140142
<Route path="goodbye" component={Goodbye} />
@@ -172,7 +174,7 @@ describe('A <Link>', function () {
172174

173175
const execNextStep = execSteps(steps, done)
174176

175-
React.render((
177+
render((
176178
<Router history={createHistory('/goodbye')} onUpdate={execNextStep}>
177179
<Route path="/" component={LinkWrapper}>
178180
<Route path="goodbye" component={Goodbye} />
@@ -208,7 +210,7 @@ describe('A <Link>', function () {
208210

209211
const execNextStep = execSteps(steps, done)
210212

211-
React.render((
213+
render((
212214
<Router history={createHistory('/goodbye')} onUpdate={execNextStep}>
213215
<Route path="/" component={LinkWrapper}>
214216
<Route path="hello" component={Hello} />
@@ -249,7 +251,7 @@ describe('A <Link>', function () {
249251

250252
const execNextStep = execSteps(steps, done)
251253

252-
React.render((
254+
render((
253255
<Router history={createHistory('/goodbye')} onUpdate={execNextStep}>
254256
<Route path="/" component={LinkWrapper}>
255257
<Route path="goodbye" component={Goodbye} />
@@ -273,7 +275,7 @@ describe('A <Link>', function () {
273275
}
274276
}
275277

276-
React.render((
278+
render((
277279
<Router history={createHistory('/')}>
278280
<Route path="/" component={LinkWrapper} />
279281
<Route path="/hello" component={Hello} />
@@ -304,7 +306,7 @@ describe('A <Link>', function () {
304306

305307
const execNextStep = execSteps(steps, done)
306308

307-
React.render((
309+
render((
308310
<Router history={createHistory('/')} onUpdate={execNextStep}>
309311
<Route path="/" component={LinkWrapper} />
310312
<Route path="/hello" component={Hello} />

modules/__tests__/Redirect-test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*eslint-env mocha */
22
import expect from 'expect'
33
import React from 'react'
4+
import { render, unmountComponentAtNode } from 'react-dom'
45
import createHistory from 'history/lib/createMemoryHistory'
56
import Redirect from '../Redirect'
67
import Router from '../Router'
@@ -14,11 +15,11 @@ describe('A <Redirect>', function () {
1415
})
1516

1617
afterEach(function () {
17-
React.unmountComponentAtNode(node)
18+
unmountComponentAtNode(node)
1819
})
1920

2021
it('works', function (done) {
21-
React.render((
22+
render((
2223
<Router history={createHistory('/notes/5')}>
2324
<Route path="/messages/:id" />
2425
<Redirect from="/notes/:id" to="/messages/:id" />
@@ -30,7 +31,7 @@ describe('A <Redirect>', function () {
3031
})
3132

3233
it('works with relative paths', function (done) {
33-
React.render((
34+
render((
3435
<Router history={createHistory('/nested/route1')}>
3536
<Route path="nested">
3637
<Route path="route2" />
@@ -44,7 +45,7 @@ describe('A <Redirect>', function () {
4445
})
4546

4647
it('works with relative paths with param', function (done) {
47-
React.render((
48+
render((
4849
<Router history={createHistory('/nested/1/route1')}>
4950
<Route path="nested/:id">
5051
<Route path="route2" />

modules/__tests__/RouteComponent-test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*eslint-env mocha */
22
import expect from 'expect'
33
import React from 'react'
4+
import { render, unmountComponentAtNode } from 'react-dom'
45
import createHistory from 'history/lib/createMemoryHistory'
56
import Router from '../Router'
67

@@ -12,7 +13,7 @@ describe('a Route Component', function () {
1213
})
1314

1415
afterEach(function () {
15-
React.unmountComponentAtNode(node)
16+
unmountComponentAtNode(node)
1617
})
1718

1819
it('injects the right props', function (done) {
@@ -39,7 +40,7 @@ describe('a Route Component', function () {
3940
expect(props.routes).toEqual([ parent, child ])
4041
}
4142

42-
React.render((
43+
render((
4344
<Router history={createHistory('/child')} routes={parent}/>
4445
), node, done)
4546
})

0 commit comments

Comments
 (0)