You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

29 lines
625 B

import counter from '../../app/scripts/core/Counter.es6';
describe('counter', () => {
it('should handle initial state', () => {
expect (
counter(0, { type: 'INCREMENT_COUNTER' })
).toEqual(1);
});
it('should handle INCREMENT_COUNTER', () => {
expect (
counter(1, { type: 'INCREMENT_COUNTER' })
).toEqual(2);
});
it('should handle DECREMENT_COUNTER', () => {
expect (
counter(2, { type: 'DECREMENT_COUNTER' })
).toEqual(1);
});
it('should handle unknown action type', () => {
expect (
counter(1, { type: 'SOMETHING_ELSE' })
).toEqual(1);
});
});