Skip to content

Instantly share code, notes, and snippets.

@pumpchaser
Created October 18, 2016 19:03
Show Gist options
  • Save pumpchaser/3ccd6ed0f53edde2acca586aeb3f0a53 to your computer and use it in GitHub Desktop.
Save pumpchaser/3ccd6ed0f53edde2acca586aeb3f0a53 to your computer and use it in GitHub Desktop.
import { combineReducers } from 'redux'
const subscribed = (state = false, action) => {
switch (action.type) {
case 'SET_SUBSCRIBED':
return true
default:
return state
}
}
const rootReducer = combineReducers({
subscribed
})
export default rootReducer
it('should handle the default action for passed in state', () => {
const action = { type: 'RANDOM-123' }
deepFreeze(action)
expect(reducer(true, action)).toEqual({ subscribed: true })
})
Expected { subscribed: false } to equal { subscribed: true }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment