mirror of
https://github.com/TheGreyDiamond/Enlight.git
synced 2026-04-01 07:10:23 +02:00
init
This commit is contained in:
31
enlightApp/test/reducers/counter.spec.ts
Normal file
31
enlightApp/test/reducers/counter.spec.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user