Created
December 16, 2015 21:50
-
-
Save iammerrick/49b4420d64f954fa6c5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import expect from 'expect'; | |
import AppConstants from '../../../app/AppConstants'; | |
import store from '../../store'; | |
import { selectLastReadMessageByChannelId } from './channelSelectors'; | |
describe('channel', () => { | |
it('should store the messageId when clearing unreads', () => { | |
const channelId = 1; | |
const messageId = 2; | |
store.dispatch({ | |
type: AppConstants.CHANNEL_UNREADS_CLEARED, | |
payload: { | |
id: channelId, | |
messageId | |
} | |
}); | |
expect(selectLastReadMessageByChannelId(store.getState(), channelId)).toEqual(messageId); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(there are times I look at how simple my reducers--and everything else in a react redux app--are to think about and wonder why I'm even writing tests at all ...)