Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / pass / store / optimistic / utils / combine-optimistic-reducers.spec.ts
blobda1962003353cccbb060d4d26eb4272a912177c7
1 import type { Reducer } from 'redux';
3 import type { WithOptimisticReducer } from '../types';
4 import { combineOptimisticReducers } from './combine-optimistic-reducers';
6 describe('combineOptimisticReducers', () => {
7     test('should keep a reference to the underlying "reducer state structure"', () => {
8         const reducer: Reducer = () => {};
10         const optimisticReducer: WithOptimisticReducer = () => {};
11         optimisticReducer.innerReducer = () => {};
13         const nestedOptimisticCombinedReducer = combineOptimisticReducers({
14             nestedOptimisticTest: optimisticReducer,
15             nestedTest: reducer,
16         });
18         const reducersMap = {
19             nestedOptimisticCombinedReducer,
20             optimisticTest: optimisticReducer,
21             test: reducer,
22         };
24         const rootReducer = combineOptimisticReducers(reducersMap);
25         expect(rootReducer.innerCombinedReducers).toEqual(reducersMap);
26     });
27 });