Add test for ME_RECEIVED

pull/10616/head
Jared Scheib 2017-04-17 12:24:43 -07:00
parent f62c4b1ba2
commit 6b62cb1b87
1 changed files with 14 additions and 0 deletions

View File

@ -51,4 +51,18 @@ describe('Shared.Reducers.authReducer', () => {
expect(reducedState.links[0]).to.deep.equal(defaultAuth.links[0])
expect(reducedState.isAuthLoading).to.equal(false)
})
it('should handle ME_REQUESTED', () => {
const reducedState = authReducer(initialState, meRequested())
expect(reducedState.isMeLoading).to.equal(true)
})
it('should handle ME_RECEIVED', () => {
const loadingState = Object.assign({}, initialState, {isMeLoading: true})
const reducedState = authReducer(loadingState, meReceived(defaultMe))
expect(reducedState.me).to.deep.equal(defaultMe)
expect(reducedState.isAuthLoading).to.equal(false)
})
})