1
0
mirror of https://github.com/TheGreyDiamond/Enlight.git synced 2026-03-31 23:00:24 +02:00
Files
Enlight/enlightApp/test/reducers/counter.spec.ts
TheGreyDiamond 015e0779a3 init
2020-11-29 17:43:34 +01:00

32 lines
812 B
TypeScript

import { AnyAction } from 'redux';
import counterReducer, {
increment,
decrement,
} from '../../app/features/counter/counterSlice';
describe('reducers', () => {
describe('counter', () => {
it('should handle initial state', () => {
expect(counterReducer(undefined, {} as AnyAction)).toMatchSnapshot();
});
it('should handle INCREMENT_COUNTER', () => {
expect(
counterReducer({ value: 1 }, { type: increment })
).toMatchSnapshot();
});
it('should handle DECREMENT_COUNTER', () => {
expect(
counterReducer({ value: 1 }, { type: decrement })
).toMatchSnapshot();
});
it('should handle unknown action type', () => {
expect(
counterReducer({ value: 1 }, { type: 'unknown' })
).toMatchSnapshot();
});
});
});