MyCrypto/spec/reducers/notifications.spec.ts
skubakdj c31490c8b4 Redux Reducer Tests (#390)
* set return type in resetWallet action creator

* update config reducer test

* update generateWallet reducer test

* update swap reducer test

* update wallet reducer test

* create customTokens reducer test

* create deterministicWallets reducer test

* create ens reducer test

* create notifications reducer test

* add crypto compare success/fail actions

* add rates reducer test

* remove unnecessary comments

* remove more comments

* remove duplicate import

* update wallet reducer test to use BN

* update dWallet reducer test to use BN

* update wallet reducer tests

* update rates reducer tests
2017-11-17 13:12:27 -08:00

29 lines
905 B
TypeScript

import { notifications } from 'reducers/notifications';
import * as notificationsActions from 'actions/notifications';
describe('customTokens reducer', () => {
const notification1 = notificationsActions.showNotification('success', 'msg');
const notification2 = notificationsActions.showNotification('danger', 'msg');
it('should handle SHOW_NOTIFICATION', () => {
const state = notifications(undefined, notification1);
expect(notifications(state, notification2)).toEqual([
notification1.payload,
notification2.payload
]);
});
it('should handle CLOSE_NOTIFICATION', () => {
const state1 = notifications(undefined, notification1);
const state2 = notifications(state1, notification2);
expect(
notifications(
state2,
notificationsActions.closeNotification(notification2.payload)
)
).toEqual([notification1.payload]);
});
});