This repository was archived by the owner on Apr 11, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +25
-12
lines changed
app/src/containers/FeatureFirstContainer Expand file tree Collapse file tree 4 files changed +25
-12
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { connect } from 'react-redux';
1111import { bindActionCreators } from 'redux' ;
1212import * 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
Original file line number Diff line number Diff line change 1- import FeatureFirstContainer from '../index' ;
1+ import { FeatureFirstContainer } from '../index' ;
22import expect from 'expect' ;
33import React from 'react' ;
44import { 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+ }
618describe ( '<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} ) ;
Original file line number Diff line number Diff 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
1515module . 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} ;
Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments