This repository was archived by the owner on Apr 11, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 18 files changed +234
-242
lines changed
containers/FeatureFirstContainer Expand file tree Collapse file tree 18 files changed +234
-242
lines changed Original file line number Diff line number Diff line change 11import React , { PropTypes } from 'react' ;
2-
32import styles from './index.module.scss' ;
43import cssModules from 'react-css-modules' ;
54
Original file line number Diff line number Diff line change 1+ exports [` <Header /> should render with default props 1` ] = `
2+ <h1 >
3+ Hello World
4+ </h1 >
5+ ` ;
Original file line number Diff line number Diff line change 11import Header from '../index' ;
2-
3- import expect from 'expect' ;
42import { shallow } from 'enzyme' ;
3+ import { shallowToJson } from 'enzyme-to-json' ;
54import React from 'react' ;
65
76describe ( '<Header />' , ( ) => {
8- it ( 'should render an h1 header element with the specified text' , ( ) => {
9- const renderedComponent = shallow (
10- < Header content = "Hello World!" />
7+ it ( 'should render with default props' , ( ) => {
8+ const wrapper = shallow (
9+ < Header
10+ content = "Hello World"
11+ />
1112 ) ;
12- expect (
13- renderedComponent
14- . find ( 'h1' )
15- . contains ( 'Hello World!' )
16- ) . toEqual ( true ) ;
13+ expect ( shallowToJson ( wrapper ) ) . toMatchSnapshot ( ) ;
1714 } ) ;
1815} ) ;
Original file line number Diff line number Diff line change 1+ exports [` <Header /> should render with default props 1` ] = `
2+ <div >
3+ <img
4+ alt = " Udacity Logo"
5+ id = " udacity-alumni-logo"
6+ src = " https://github.com/RyanCCollins/cdn/blob/master/alumni-webapp/udacity-alumni-png.png?raw=true" />
7+ </div >
8+ ` ;
Original file line number Diff line number Diff line change 1+ import { shallow } from 'enzyme' ;
2+ import React from 'react' ;
3+ import { shallowToJson } from 'enzyme-to-json' ;
4+ import LogoImage from '../index' ;
5+
6+ describe ( '<Header />' , ( ) => {
7+ it ( 'should render with default props' , ( ) => {
8+ const wrapper = shallow (
9+ < LogoImage
10+ imageSource = "https://github.com/RyanCCollins/cdn/blob/master/alumni-webapp/udacity-alumni-png.png?raw=true"
11+ />
12+ ) ;
13+ expect ( shallowToJson ( wrapper ) ) . toMatchSnapshot ( ) ;
14+ } ) ;
15+ } ) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const Navbar = () => (
2525 < Anchor href = "#" >
2626 Third
2727 </ Anchor >
28- < Search dropAlign = { { " right" : " right" } } />
28+ < Search dropAlign = { { right : ' right' } } />
2929 </ Menu >
3030 </ Header >
3131 </ div >
Original file line number Diff line number Diff line change 1+ exports [` <Navbar /> should render with default props 1` ] = `
2+ <div >
3+ <Header
4+ align = " center"
5+ direction = " row"
6+ justify = " between"
7+ pad = {
8+ Object {
9+ " between" : " small" ,
10+ " horizontal" : " none" ,
11+ " vertical" : " none"
12+ }
13+ }
14+ responsive = { false }
15+ tag = " header" >
16+ <Title
17+ responsive = { true } >
18+ <img
19+ alt = " logo"
20+ src = { Object {}} />
21+ </Title >
22+ <Menu
23+ align = " center"
24+ closeOnClick = { true }
25+ direction = " row"
26+ dropAlign = {
27+ Object {
28+ " left" : " left" ,
29+ " top" : " top"
30+ }
31+ }
32+ pad = " none"
33+ responsive = { false } >
34+ <Anchor
35+ className = " active"
36+ href = " #"
37+ tag = " a" >
38+ First
39+ </Anchor >
40+ <Anchor
41+ href = " #"
42+ tag = " a" >
43+ Second
44+ </Anchor >
45+ <Anchor
46+ href = " #"
47+ tag = " a" >
48+ Third
49+ </Anchor >
50+ <Search
51+ align = " left"
52+ dropAlign = {
53+ Object {
54+ " right" : " right"
55+ }
56+ }
57+ iconAlign = " end"
58+ inline = { false }
59+ responsive = { true } />
60+ </Menu >
61+ </Header >
62+ </div >
63+ ` ;
Original file line number Diff line number Diff line change 1+ import { shallow } from 'enzyme' ;
2+ import React from 'react' ;
3+ import { shallowToJson } from 'enzyme-to-json' ;
4+ import Navbar from '../index' ;
5+
6+ describe ( '<Navbar />' , ( ) => {
7+ it ( 'should render with default props' , ( ) => {
8+ const wrapper = shallow (
9+ < Navbar />
10+ ) ;
11+ expect ( shallowToJson ( wrapper ) ) . toMatchSnapshot ( ) ;
12+ } ) ;
13+ } ) ;
Original file line number Diff line number Diff line change 55 CLEAR_DATA_ERROR ,
66} from './constants' ;
77
8- const initialState = {
8+ export const initialState = {
99 isLoading : false ,
1010 data : { } ,
1111 error : { } ,
Original file line number Diff line number Diff line change 1+ exports [` <FeatureFirstContainer /> renders with default props 1` ] = `
2+ <FeatureFirstContainer
3+ actions = {
4+ Object {
5+ " clearDataError" : [Function anonymous ],
6+ " loadDataFailure" : [Function anonymous ],
7+ " loadDataInitiation" : [Function anonymous ],
8+ " loadDataSuccess" : [Function anonymous ]
9+ }
10+ }
11+ store = {
12+ Object {
13+ " clearActions" : [Function clearActions ],
14+ " dispatch" : [Function anonymous ],
15+ " getActions" : [Function getActions ],
16+ " getState" : [Function getState ],
17+ " subscribe" : [Function subscribe ]
18+ }
19+ } />
20+ ` ;
You can’t perform that action at this time.
0 commit comments