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,
19 nestedOptimisticCombinedReducer,
20 optimisticTest: optimisticReducer,
24 const rootReducer = combineOptimisticReducers(reducersMap);
25 expect(rootReducer.innerCombinedReducers).toEqual(reducersMap);