mirror of
https://github.com/TheGreyDiamond/Enlight.git
synced 2026-03-31 23:00:24 +02:00
init
This commit is contained in:
25
enlightApp/test/reducers/__snapshots__/counter.spec.ts.snap
Normal file
25
enlightApp/test/reducers/__snapshots__/counter.spec.ts.snap
Normal 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,
|
||||
}
|
||||
`;
|
||||
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