1
0
mirror of https://github.com/TheGreyDiamond/Enlight.git synced 2026-03-31 23:00:24 +02:00
This commit is contained in:
TheGreyDiamond
2020-11-29 17:43:34 +01:00
parent 05ad177917
commit 015e0779a3
112 changed files with 18004 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`reducers counter should handle DECREMENT_COUNTER 1`] = `
Object {
"value": 0,
}
`;
exports[`reducers counter should handle INCREMENT_COUNTER 1`] = `
Object {
"value": 2,
}
`;
exports[`reducers counter should handle initial state 1`] = `
Object {
"value": 0,
}
`;
exports[`reducers counter should handle unknown action type 1`] = `
Object {
"value": 1,
}
`;

View 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();
});
});
});