diff --git a/.travis.yml b/.travis.yml index efb0983..e51a468 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,7 @@ language: node_js node_js: - "8" +notifications: + email: + on_success: never + on_failure: always diff --git a/package.json b/package.json index a8bde80..179140e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-grid-list", - "version": "1.0.2", + "version": "1.0.4", "main": "index.js", "license": "Apache-2.0", "author": "Gustavo Gard (https://gusgard.com)", @@ -62,10 +62,17 @@ "jest": { "preset": "react-native", "setupTestFrameworkScriptFile": "./enzyme.js", - "modulePathIgnorePatterns": ["/example/node_modules/"], - "snapshotSerializers": ["./node_modules/enzyme-to-json/serializer"] + "modulePathIgnorePatterns": [ + "/example/node_modules/" + ], + "snapshotSerializers": [ + "./node_modules/enzyme-to-json/serializer" + ] }, "pre-commit": { - "run": ["lint", "test"] + "run": [ + "lint", + "test" + ] } } diff --git a/src/components/GridList/__snapshots__/test.js.snap b/src/components/GridList/__snapshots__/test.js.snap index db196d6..ce89c39 100644 --- a/src/components/GridList/__snapshots__/test.js.snap +++ b/src/components/GridList/__snapshots__/test.js.snap @@ -1,6 +1,88 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders correctly 1`] = ` +exports[`grid list renders correctly 1`] = ` + +`; + +exports[`grid list renders showAnimation 1`] = ` + +`; + +exports[`grid list renders showSeparator 1`] = ` - {renderItem({ item, index, stagger: this.stagger[index] })} - - ) : ( + return ( - {renderItem({ item, index })} + {showAnimation ? ( + + {renderItem({ item, index, stagger: this.stagger[index] })} + + ) : ( + renderItem({ item, index }) + )} ); }; @@ -92,7 +93,7 @@ export default class GridList extends PureComponent { const { showSeparator, ...props } = this.props; return ( showSeparator ? : null diff --git a/src/components/GridList/test.js b/src/components/GridList/test.js index 4e2dac7..c5ee385 100644 --- a/src/components/GridList/test.js +++ b/src/components/GridList/test.js @@ -7,12 +7,39 @@ import GridList from './index'; const logo = { uri: 'https://...' }; const items = [{ id: 1, thumbnail: logo }, { id: 2, thumbnail: logo }]; -it('renders correctly', () => { - const wrapper = shallow( - } - />, - ); - expect(wrapper).toMatchSnapshot(); +describe('grid list', () => { + it('renders correctly', () => { + const wrapper = shallow( + } + />, + ); + expect(wrapper).toMatchSnapshot(); + }); + + it('renders showSeparator', () => { + const wrapper = shallow( + } + />, + ); + expect(wrapper).toMatchSnapshot(); + }); + + it('renders showAnimation', () => { + const wrapper = shallow( + ( + stagger.start()} /> + )} + />, + ); + expect(wrapper).toMatchSnapshot(); + }); });