diff --git a/test/reducers/__snapshots__/info.spec.js.snap b/test/reducers/__snapshots__/info.spec.js.snap new file mode 100644 index 00000000..1fd77f2b --- /dev/null +++ b/test/reducers/__snapshots__/info.spec.js.snap @@ -0,0 +1,22 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`reducers infoReducer should correctly getInfo 1`] = ` +Object { + "data": Object {}, + "infoLoading": true, +} +`; + +exports[`reducers infoReducer should correctly receiveInfo 1`] = ` +Object { + "data": "foo", + "infoLoading": false, +} +`; + +exports[`reducers infoReducer should handle initial state 1`] = ` +Object { + "data": Object {}, + "infoLoading": false, +} +`; diff --git a/test/reducers/info.spec.js b/test/reducers/info.spec.js new file mode 100644 index 00000000..fd69ff84 --- /dev/null +++ b/test/reducers/info.spec.js @@ -0,0 +1,28 @@ +import infoReducer, { + GET_INFO, + RECEIVE_INFO +} from '../../app/reducers/info' + +describe('reducers', () => { + describe('infoReducer', () => { + it('should handle initial state', () => { + expect(infoReducer(undefined, {})).toMatchSnapshot() + }) + + it('should have GET_INFO', () => { + expect(GET_INFO).toEqual('GET_INFO') + }) + + it('should have RECEIVE_INFO', () => { + expect(RECEIVE_INFO).toEqual('RECEIVE_INFO') + }) + + it('should correctly getInfo', () => { + expect(infoReducer(undefined, { type: GET_INFO })).toMatchSnapshot() + }) + + it('should correctly receiveInfo', () => { + expect(infoReducer(undefined, { type: RECEIVE_INFO, data: 'foo' })).toMatchSnapshot() + }) + }) +}) \ No newline at end of file