2020-06-09 18:08:07 -07:00
|
|
|
import reducer from '../alerts';
|
2020-07-08 20:19:55 -07:00
|
|
|
import { List as ImmutableList } from 'immutable';
|
|
|
|
//import * as actions from 'soapbox/actions/alerts';
|
2020-06-09 18:08:07 -07:00
|
|
|
|
|
|
|
describe('alerts reducer', () => {
|
|
|
|
it('should return the initial state', () => {
|
|
|
|
expect(reducer(undefined, {})).toEqual(ImmutableList());
|
|
|
|
});
|
2020-07-05 17:38:32 -07:00
|
|
|
|
2020-07-08 20:05:22 -07:00
|
|
|
// it('should handle ALERT_SHOW', () => {
|
|
|
|
// const state = ImmutableMap({ key: 2 });
|
|
|
|
// const action = {
|
|
|
|
// type: actions.ALERT_SHOW,
|
|
|
|
// title: 'alert_title',
|
|
|
|
// message: 'this is an alert message',
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// key: 2,
|
|
|
|
// });
|
|
|
|
// });
|
2020-07-05 17:38:32 -07:00
|
|
|
|
2020-07-08 20:05:22 -07:00
|
|
|
// it('should handle ALERT_DISMISS', () => {
|
|
|
|
// const state = ImmutableMap({ key: 2, title: 'title', message: 'message' });
|
|
|
|
// const action = {
|
|
|
|
// type: actions.ALERT_DISMISS,
|
|
|
|
// alert: { key: 2 },
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// key: 2,
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle ALERT_CLEAR', () => {
|
|
|
|
// const state = ImmutableMap({ });
|
|
|
|
// const action = {
|
|
|
|
// type: actions.ALERT_CLEAR,
|
|
|
|
// key: 2,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// });
|
|
|
|
// });
|
2020-07-05 17:38:32 -07:00
|
|
|
|
2020-06-09 18:08:07 -07:00
|
|
|
});
|