Skip to content
This repository was archived by the owner on Apr 11, 2019. It is now read-only.

Commit c525923

Browse files
committed
Fix: finish testing integrations
1 parent 547a35f commit c525923

File tree

4 files changed

+25
-12
lines changed

4 files changed

+25
-12
lines changed

app/src/containers/FeatureFirstContainer/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { connect } from 'react-redux';
1111
import { bindActionCreators } from 'redux';
1212
import * as MyActions from './actions';
1313

14-
class FeatureFirstContainer extends Component {
14+
export class FeatureFirstContainer extends Component {
1515
constructor(props) {
1616
super(props);
1717
this.initiateLoading = this.initiateLoading.bind(this);
@@ -36,7 +36,7 @@ class FeatureFirstContainer extends Component {
3636
:
3737
<div>
3838
<LogoImage
39-
imageSource="https://github.com/RyanCCollins/cdn/raw/master/alumni-webapp/udacity-alumni-small.png?raw=true"
39+
imageSource="https://github.com/RyanCCollins/cdn/raw/master/alumni-webapp/udacity-alumni-small.png?raw=true"
4040
/>
4141
<div className={styles.headerText}>
4242
<Header
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1-
import FeatureFirstContainer from '../index';
1+
import { FeatureFirstContainer } from '../index';
22
import expect from 'expect';
33
import React from 'react';
44
import { shallow } from 'enzyme';
55

6+
function setup() {
7+
const props = {
8+
isLoading: true,
9+
};
10+
const wrapper = shallow(
11+
<FeatureFirstContainer isLoading={props.isLoading} />
12+
);
13+
return {
14+
props,
15+
wrapper,
16+
};
17+
}
618
describe('<FeatureFirstContainer />', () => {
719
it('should show a loading indicator while loading', () => {
8-
const renderedComponent = shallow(
9-
<FeatureFirstContainer isLoading />
10-
);
20+
const {
21+
wrapper,
22+
} = setup();
1123
expect(
12-
renderedComponent.contains(
24+
wrapper.contains(
1325
<h1>LOADING...</h1>
1426
)
15-
).toEqual(true);
27+
).toBe(true);
1628
});
1729
});

config/webpack/webpack.test.babel.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const modules = [
1010
'node_modules',
1111
];
1212

13-
const ROOT_PATH = path.resolve('../../' + __dirname);
13+
const ROOT_PATH = path.resolve(__dirname);
1414

1515
module.exports = {
1616
devtool: 'inline-source-map',
@@ -97,9 +97,9 @@ module.exports = {
9797
alias: {
9898
// required for enzyme to work properly
9999
sinon: 'sinon/pkg/sinon',
100-
components: path.resolve(ROOT_PATH, 'app/src/components'),
101-
containers: path.resolve(ROOT_PATH, 'app/src/containers'),
102-
pages: path.resolve(ROOT_PATH, 'app/src/pages'),
100+
components: path.resolve(ROOT_PATH, '../../app/src/components'),
101+
containers: path.resolve(ROOT_PATH, '../../app/src/containers'),
102+
pages: path.resolve(ROOT_PATH, '../../app/src/pages'),
103103
},
104104
},
105105
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
"react-css-modules": "^3.7.6",
124124
"react-hot-loader": "^1.3.0",
125125
"redux-devtools": "^3.0.1",
126+
"redux-mock-store": "^1.1.4",
126127
"webpack-dev-server": "^1.14.0",
127128
"webpack-visualizer-plugin": "^0.1.5"
128129
}

0 commit comments

Comments
 (0)