1- import React , { PropTypes } from 'react' ;
2- import renderer from 'react-test-renderer' ;
3- import EmptyHandler from '../../src/components/EmptyHandler' ;
1+ import React , { PropTypes } from 'react'
2+ import renderer from 'react-test-renderer'
3+ import EmptyHandler from '../../src/components/EmptyHandler'
44
5- const TestComponent = ( ) => < h1 > Test</ h1 > ;
6- const EmptyComponent = ( { children } ) => < h2 className = " empty" > { children } </ h2 > ;
7- EmptyComponent . propTypes = { children : PropTypes . string } ;
8- const componentPropsFilled = { list : [ 'abc' , 'def' ] } ;
9- const componentPropsEmpty = { list : [ ] } ;
10- const emptyMessage = 'no results found' ;
5+ const TestComponent = ( ) => < h1 > Test</ h1 >
6+ const EmptyComponent = ( { children } ) => < h2 className = ' empty' > { children } </ h2 >
7+ EmptyComponent . propTypes = { children : PropTypes . string }
8+ const componentPropsFilled = { list : [ 'abc' , 'def' ] }
9+ const componentPropsEmpty = { list : [ ] }
10+ const emptyMessage = 'no results found'
1111
1212describe ( 'EmptyHandler' , ( ) => {
13- it ( 'should return null when called without Component and is not empty', ( ) => {
13+ test ( 'returns null when called without Component and is not empty', ( ) => {
1414 const tree = renderer . create (
1515 < EmptyHandler
1616 checkedProperty = { componentPropsFilled . list }
1717 message = { emptyMessage }
1818 /> ,
19- ) ;
20- expect ( tree ) . toMatchSnapshot ( ) ;
21- } ) ;
19+ )
20+ expect ( tree ) . toMatchSnapshot ( )
21+ } )
2222
23- it ( 'should return the component when the element in componentProps is not empty', ( ) => {
23+ test ( 'returns the component when the element in componentProps is not empty', ( ) => {
2424 const tree = renderer . create (
2525 < EmptyHandler
2626 checkedProperty = { componentPropsFilled . list }
2727 message = { emptyMessage }
2828 >
2929 < TestComponent />
3030 </ EmptyHandler > ,
31- ) ;
32- expect ( tree . toJSON ( ) ) . toMatchSnapshot ( ) ;
33- } ) ;
31+ )
32+ expect ( tree . toJSON ( ) ) . toMatchSnapshot ( )
33+ } )
3434
35- it ( 'should return the EmptyComponent, when the list is empty and called with EmptyComponent', ( ) => {
35+ test ( 'returns the EmptyComponent, when the list is empty and called with EmptyComponent', ( ) => {
3636 const tree = renderer . create (
3737 < EmptyHandler
3838 EmptyComponent = { EmptyComponent }
@@ -41,26 +41,26 @@ describe('EmptyHandler', () => {
4141 >
4242 < TestComponent />
4343 </ EmptyHandler > ,
44- ) ;
45- expect ( tree . toJSON ( ) ) . toMatchSnapshot ( ) ;
46- } ) ;
44+ )
45+ expect ( tree . toJSON ( ) ) . toMatchSnapshot ( )
46+ } )
4747
48- it ( 'should return the EmptyMessage, when the list is empty', ( ) => {
48+ test ( 'returns the EmptyMessage, when the list is empty', ( ) => {
4949 const tree = renderer . create (
5050 < EmptyHandler
5151 checkedProperty = { componentPropsEmpty . list }
5252 message = { emptyMessage }
5353 /> ,
54- ) ;
55- expect ( tree . toJSON ( ) ) . toMatchSnapshot ( ) ;
56- } ) ;
54+ )
55+ expect ( tree . toJSON ( ) ) . toMatchSnapshot ( )
56+ } )
5757
58- it ( 'should return the EmptyMessage, when called without checkedProperty', ( ) => {
58+ test ( 'returns the EmptyMessage, when called without checkedProperty', ( ) => {
5959 const tree = renderer . create (
6060 < EmptyHandler message = { emptyMessage } >
6161 < TestComponent />
6262 </ EmptyHandler > ,
63- ) ;
64- expect ( tree . toJSON ( ) ) . toMatchSnapshot ( ) ;
65- } ) ;
66- } ) ;
63+ )
64+ expect ( tree . toJSON ( ) ) . toMatchSnapshot ( )
65+ } )
66+ } )
0 commit comments