Slide 63
Slide 63 text
import createTestStore from 'ph/createTestStore';
import { clearNotice, receiveNotice } from 'ph/modules/notice';
describe('notice', () => {
const getState = (store) => store.getState().notice;
describe(receiveNotice.name, () => {
it('sets a notice object', () => {
const store = createTestStore();
const notice = { type: 'notice', message: 'submitted' }
store.dispatch(receiveNotice(notice));
expect(getState(store)).to.deep.equal(notice);
});
});
describe(clearNotice.name, () => {
it('sets a notice object', () => {
const store = createTestStore();
store.dispatch(clearNotice());
expect(getState(store)).to.equal(null);
});
});
});