1
1
/*eslint-env mocha */
2
2
/*eslint react/prop-types: 0*/
3
3
import expect from 'expect'
4
- import React from 'react'
4
+ import React , { Component } from 'react'
5
5
import { render , unmountComponentAtNode } from 'react-dom'
6
6
import createHistory from 'history/lib/createMemoryHistory'
7
7
import IndexRoute from '../IndexRoute'
@@ -12,7 +12,7 @@ import Link from '../Link'
12
12
13
13
describe ( 'An <IndexLink>' , function ( ) {
14
14
15
- class App extends React . Component {
15
+ class App extends Component {
16
16
render ( ) {
17
17
return (
18
18
< div >
@@ -28,51 +28,51 @@ describe('An <IndexLink>', function () {
28
28
}
29
29
}
30
30
31
- class Website extends React . Component {
31
+ class Wrapper extends Component {
32
32
render ( ) {
33
33
return < div > website wrapper { this . props . children } </ div >
34
34
}
35
35
}
36
36
37
- class WebsiteOverview extends React . Component {
37
+ class IndexPage extends Component {
38
38
render ( ) {
39
39
return < div > website overview</ div >
40
40
}
41
41
}
42
42
43
- class WebsiteContact extends React . Component {
43
+ class ContactPage extends Component {
44
44
render ( ) {
45
45
return < div > contact page</ div >
46
46
}
47
47
}
48
48
49
- class WebsiteProducts extends React . Component {
49
+ class ProductsPage extends Component {
50
50
render ( ) {
51
51
return < div > website products { this . props . children } </ div >
52
52
}
53
53
}
54
54
55
- class WebsiteProductsProduct extends React . Component {
55
+ class ProductPage extends Component {
56
56
render ( ) {
57
57
return < div > specific product { this . props . params . productId } </ div >
58
58
}
59
59
}
60
60
61
- class WebsiteProductsIndex extends React . Component {
61
+ class ProductsIndexPage extends Component {
62
62
render ( ) {
63
63
return < div > list of products</ div >
64
64
}
65
65
}
66
66
67
67
const routes = (
68
68
< Route component = { App } >
69
- < Route path = "/website" component = { Website } >
70
- < Route path = "products" component = { WebsiteProducts } >
71
- < Route path = ":productId" component = { WebsiteProductsProduct } />
72
- < IndexRoute component = { WebsiteProductsIndex } />
69
+ < Route path = "/website" component = { Wrapper } >
70
+ < Route path = "products" component = { ProductsPage } >
71
+ < Route path = ":productId" component = { ProductPage } />
72
+ < IndexRoute component = { ProductsIndexPage } />
73
73
</ Route >
74
- < Route path = "contact" component = { WebsiteContact } />
75
- < IndexRoute component = { WebsiteOverview } />
74
+ < Route path = "contact" component = { ContactPage } />
75
+ < IndexRoute component = { IndexPage } />
76
76
</ Route >
77
77
</ Route >
78
78
)
0 commit comments