Skip to content

Instantly share code, notes, and snippets.

@iammerrick
Created December 16, 2015 21:50
Show Gist options
  • Save iammerrick/49b4420d64f954fa6c5e to your computer and use it in GitHub Desktop.
Save iammerrick/49b4420d64f954fa6c5e to your computer and use it in GitHub Desktop.
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);
});
});
@ryanflorence
Copy link

(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 ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment