Jack Mallers
8 years ago
2 changed files with 50 additions and 0 deletions
@ -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, |
||||
|
} |
||||
|
`; |
@ -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() |
||||
|
}) |
||||
|
}) |
||||
|
}) |
Loading…
Reference in new issue