Skip to content

Commit 02a9971

Browse files
authored
Merge pull request #253 from we3x/feature/testing
Clear test
2 parents 8ccbffc + c4ca8a5 commit 02a9971

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+515
-408
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "server.js",
66
"scripts": {
77
"start": "webpack-dev-server --inline --hot --host 0.0.0.0 --color",
8+
"pretest": "eslint src/",
89
"test": "NODE_ENV=production node_modules/.bin/babel-node node_modules/.bin/babel-istanbul cover node_modules/.bin/_mocha -- -R xunit-file src/test.js",
910
"coverage": "NODE_ENV=production istanbul report cobertura --dir shippable/codecoverage/",
1011
"build": "webpack -p --config webpack.config.prod.js src/index.js",

src/components/auth/tests/auth.js

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
1+
/* eslint no-undef: 0 */
2+
/* eslint no-unused-expressions: 0 */
3+
/* eslint no-sequences: 0 */
14
import expect from 'expect';
25
import actions from '../actions';
36
import store from '../../../store';
47
import { LOGIN } from '../constants';
58

69
const loginTest = describe('Testing login', () => {
7-
it('get pending state', () => {
8-
expect(store.dispatch(actions.begin()))
10+
it('get pending state', () => {
11+
expect(store.dispatch(actions.begin()))
912
.toEqual({
1013
payload: {
1114
status: 'pending',
1215
},
1316
type: LOGIN,
1417
});
1518
}),
16-
it('get error state', () => {
17-
expect(store.dispatch(actions.fail({ message: 'ErorR'})))
18-
.toEqual({
19-
payload: {
20-
status: 'error',
21-
error: 'ErorR',
22-
},
23-
type: LOGIN,
24-
});
25-
});
19+
it('get error state', () => {
20+
expect(store.dispatch(actions.fail({ message: 'ErorR' })))
21+
.toEqual({
22+
payload: {
23+
status: 'error',
24+
error: 'ErorR',
25+
},
26+
type: LOGIN,
27+
});
28+
});
2629
});
2730

2831
export default loginTest;

src/components/cluster/components/provider/components/create.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ const ProviderCreate = React.createClass({
106106
{
107107
this.props.plugins.map(
108108
plugin =>
109-
<option
110-
key={plugin.type}
111-
value={plugin.type}
112-
> {plugin.type}</option>
109+
<option
110+
key={plugin.type}
111+
value={plugin.type}
112+
> {plugin.type}</option>
113113
)
114114
}
115115
</select>

src/components/cluster/components/provider/components/detail.js

+22-19
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,28 @@ const ProviderDetail = React.createClass({
6060
}
6161
return (
6262
<div>
63-
<h2>Provider {this.props.provider.name}</h2>
64-
<ul className="item__list">
65-
<li className="item__heading">
66-
Name:
67-
<InlineEdit
68-
text={this.props.provider.name}
69-
change={this.dataChanged}
70-
paramName="name"
71-
/>
72-
</li>
73-
<li className="item__child">
74-
<Link to={
75-
`/clusters/${clusterId}/providers/${this.props.provider.name}/hosts/`
76-
}
77-
>
78-
Hosts
79-
</Link>
80-
</li>
81-
</ul>
63+
<h2>
64+
Provider {this.props.provider.name}
65+
</h2>
66+
<ul className="item__list">
67+
<li className="item__heading">
68+
Name:
69+
<InlineEdit
70+
text={this.props.provider.name}
71+
change={this.dataChanged}
72+
paramName="name"
73+
/>
74+
</li>
75+
<li className="item__child">
76+
<Link
77+
to={
78+
`/clusters/${clusterId}/providers/${this.props.provider.name}/hosts/`
79+
}
80+
>
81+
Hosts
82+
</Link>
83+
</li>
84+
</ul>
8285
<Link to={`/clusters/${clusterId}/providers/${this.props.provider.name}/remove/`}>
8386
Remove
8487
</Link>

src/components/cluster/components/provider/components/host/components/create.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
33
import actions from '../actions/create';
44
import store from '../../../../../../../store';
55
import { history } from '../../../../../../../constants';
6-
import Spinner from '../../../.../../../../../layout/spinner';
6+
import Spinner from '../../../../../../layout/spinner';
77

88

99
const errorMessages = {

src/components/cluster/components/provider/components/host/index.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ const HostList = React.createClass({
4848
detailLink += `/hosts/${host.hostname}/`;
4949
return (
5050
<li key={host.hostname}>
51-
<Link
52-
key={host.hostname}
53-
to={detailLink}
54-
host={host}
55-
> {host.hostname} </Link> </li>
51+
<Link
52+
key={host.hostname}
53+
to={detailLink}
54+
host={host}
55+
> {host.hostname} </Link>
56+
</li>
5657
);
5758
}
5859
)
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1+
/* eslint no-undef: 0 */
2+
/* eslint no-unused-expressions: 0 */
3+
/* eslint no-sequences: 0 */
14
import expect from 'expect';
25
import actions from '../actions/create';
36
import store from '../../../../../../../store';
47
import { HOST_CREATE } from '../constants';
58

69

710
const hostCreateTest = describe('Testing create of host', () => {
8-
it('get initial state', () => {
9-
expect(store.dispatch(actions.reset()))
11+
it('get initial state', () => {
12+
expect(store.dispatch(actions.reset()))
1013
.toEqual({
1114
payload: {
1215
status: 'initial',
1316
},
1417
type: HOST_CREATE,
15-
})
18+
});
1619
}),
1720
it('get success state', () => {
1821
expect(store.dispatch(actions.success({})))
@@ -22,17 +25,17 @@ const hostCreateTest = describe('Testing create of host', () => {
2225
status: 'success',
2326
},
2427
type: HOST_CREATE,
25-
})
26-
}),
28+
});
29+
}),
2730
it('get pending state', () => {
2831
expect(store.dispatch(actions.begin()))
2932
.toEqual({
3033
payload: {
3134
status: 'pending',
3235
},
3336
type: HOST_CREATE,
34-
})
35-
}),
37+
});
38+
}),
3639
it('get error state', () => {
3740
expect(store.dispatch(actions.fail('ErorR')))
3841
.toEqual({
@@ -41,8 +44,8 @@ const hostCreateTest = describe('Testing create of host', () => {
4144
error: 'ErorR',
4245
},
4346
type: HOST_CREATE,
44-
})
45-
})
47+
});
48+
});
4649
});
4750

4851
export default hostCreateTest;
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1+
/* eslint no-undef: 0 */
2+
/* eslint no-unused-expressions: 0 */
3+
/* eslint no-sequences: 0 */
14
import expect from 'expect';
25
import actions from '../actions/detail';
36
import store from '../../../../../../../store';
47
import { HOST_DETAIL } from '../constants';
58

69

710
const hostDetailTest = describe('Testing detail of host', () => {
8-
it('get initial state', () => {
9-
expect(store.dispatch(actions.reset()))
11+
it('get initial state', () => {
12+
expect(store.dispatch(actions.reset()))
1013
.toEqual({
1114
payload: {
1215
status: 'initial',
1316
},
1417
type: HOST_DETAIL,
15-
})
18+
});
1619
}),
1720
it('get success state', () => {
1821
expect(store.dispatch(actions.success({})))
@@ -22,17 +25,17 @@ const hostDetailTest = describe('Testing detail of host', () => {
2225
status: 'success',
2326
},
2427
type: HOST_DETAIL,
25-
})
26-
}),
28+
});
29+
}),
2730
it('get pending state', () => {
2831
expect(store.dispatch(actions.begin()))
2932
.toEqual({
3033
payload: {
3134
status: 'pending',
3235
},
3336
type: HOST_DETAIL,
34-
})
35-
}),
37+
});
38+
}),
3639
it('get error state', () => {
3740
expect(store.dispatch(actions.fail('ErorR')))
3841
.toEqual({
@@ -41,8 +44,8 @@ const hostDetailTest = describe('Testing detail of host', () => {
4144
error: 'ErorR',
4245
},
4346
type: HOST_DETAIL,
44-
})
45-
})
47+
});
48+
});
4649
});
4750

4851
export default hostDetailTest;
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1+
/* eslint no-undef: 0 */
2+
/* eslint no-unused-expressions: 0 */
3+
/* eslint no-sequences: 0 */
14
import expect from 'expect';
25
import actions from '../actions/edit';
36
import store from '../../../../../../../store';
47
import { HOST_EDIT } from '../constants';
58

69

710
const hostEditTest = describe('Testing edit of host', () => {
8-
it('get initial state', () => {
9-
expect(store.dispatch(actions.reset()))
11+
it('get initial state', () => {
12+
expect(store.dispatch(actions.reset()))
1013
.toEqual({
1114
payload: {
1215
status: 'initial',
1316
},
1417
type: HOST_EDIT,
15-
})
18+
});
1619
}),
1720
it('get success state', () => {
1821
expect(store.dispatch(actions.success({})))
@@ -22,17 +25,17 @@ const hostEditTest = describe('Testing edit of host', () => {
2225
status: 'success',
2326
},
2427
type: HOST_EDIT,
25-
})
26-
}),
28+
});
29+
}),
2730
it('get pending state', () => {
2831
expect(store.dispatch(actions.begin()))
2932
.toEqual({
3033
payload: {
3134
status: 'pending',
3235
},
3336
type: HOST_EDIT,
34-
})
35-
}),
37+
});
38+
}),
3639
it('get error state', () => {
3740
expect(store.dispatch(actions.fail('ErorR')))
3841
.toEqual({
@@ -41,8 +44,8 @@ const hostEditTest = describe('Testing edit of host', () => {
4144
error: 'ErorR',
4245
},
4346
type: HOST_EDIT,
44-
})
45-
})
47+
});
48+
});
4649
});
4750

4851
export default hostEditTest;
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
/* eslint no-undef: 0 */
2+
/* eslint no-unused-expressions: 0 */
3+
/* eslint no-sequences: 0 */
14
import expect from 'expect';
25
import actions from '../actions/list';
36
import store from '../../../../../../../store';
47
import { HOST_LIST } from '../constants';
58

69

710
const hostListTest = describe('Testing host list', () => {
8-
it('get initial state', () => {
9-
expect(store.dispatch(actions.reset()))
11+
it('get initial state', () => {
12+
expect(store.dispatch(actions.reset()))
1013
.toEqual({
1114
payload: {
1215
status: 'initial',
1316
hosts: [],
1417
},
1518
type: HOST_LIST,
16-
})
19+
});
1720
}),
1821
it('get success state', () => {
1922
expect(store.dispatch(actions.success({})))
@@ -23,8 +26,8 @@ const hostListTest = describe('Testing host list', () => {
2326
status: 'success',
2427
},
2528
type: HOST_LIST,
26-
})
27-
}),
29+
});
30+
}),
2831
it('get pending state', () => {
2932
expect(store.dispatch(actions.begin()))
3033
.toEqual({
@@ -33,19 +36,19 @@ const hostListTest = describe('Testing host list', () => {
3336
hosts: [],
3437
},
3538
type: HOST_LIST,
36-
})
37-
}),
39+
});
40+
}),
3841

3942
it('get error state', () => {
4043
expect(store.dispatch(actions.fail('erroR')))
4144
.toEqual({
4245
payload: {
4346
status: 'error',
44-
error: 'erroR'
47+
error: 'erroR',
4548
},
4649
type: HOST_LIST,
47-
})
48-
})
50+
});
51+
});
4952
});
5053

5154
export default hostListTest;

0 commit comments

Comments
 (0)