diff --git a/src/routes/safe/store/test/safe.selector.js b/src/routes/safe/store/test/safe.selector.js index 33f3d75b..c8ba8f71 100644 --- a/src/routes/safe/store/test/safe.selector.js +++ b/src/routes/safe/store/test/safe.selector.js @@ -3,7 +3,7 @@ import { Map } from 'immutable' import { type Match } from 'react-router-dom' import { SAFE_REDUCER_ID } from '~/routes/safe/store/reducer/safe' import { type Safe } from '~/routes/safe/store/model/safe' -import { SafeFactory } from '~/routes/safe/store/test/builder/index.builder' +import { SafeFactory } from '~/routes/safe/store/test/builder/safe.builder' import { safeSelector } from '../selectors' const buildMathPropsFrom = (address): Match => ({ @@ -19,7 +19,11 @@ const safeSelectorTests = () => { describe('Safe Selector[safeSelector]', () => { it('should return empty list when no safes', () => { // GIVEN - const reduxStore = { [SAFE_REDUCER_ID]: Map(), providers: undefined } + const reduxStore = { + [SAFE_REDUCER_ID]: Map(), + providers: undefined, + balances: undefined, + } const match: Match = buildMathPropsFrom('fooAddress') // WHEN @@ -38,7 +42,11 @@ const safeSelectorTests = () => { const match: Match = buildMathPropsFrom('fooAddress') const undefMatch: Match = buildMathPropsFrom('inventedAddress') - const reduxStore = { [SAFE_REDUCER_ID]: map, providers: undefined } + const reduxStore = { + [SAFE_REDUCER_ID]: map, + providers: undefined, + balances: undefined, + } // WHEN const oneOwnerSafe = safeSelector(reduxStore, { match }) diff --git a/src/routes/safeList/store/test/safes.selector.js b/src/routes/safeList/store/test/safes.selector.js index 4fa5cb4c..808547df 100644 --- a/src/routes/safeList/store/test/safes.selector.js +++ b/src/routes/safeList/store/test/safes.selector.js @@ -2,14 +2,18 @@ import { List, Map } from 'immutable' import { SAFE_REDUCER_ID } from '~/routes/safe/store/reducer/safe' import { type Safe } from '~/routes/safe/store/model/safe' -import { SafeFactory } from '~/routes/safe/store/test/builder/index.builder' +import { SafeFactory } from '~/routes/safe/store/test/builder/safe.builder' import { safesListSelector } from '../selectors' const safesListSelectorTests = () => { describe('Safes Selector[safesSelector]', () => { it('should return empty list when no safes', () => { // GIVEN - const reduxStore = { [SAFE_REDUCER_ID]: Map(), providers: undefined } + const reduxStore = { + [SAFE_REDUCER_ID]: Map(), + providers: undefined, + balances: undefined, + } const emptyList = List([]) // WHEN @@ -25,7 +29,11 @@ const safesListSelectorTests = () => { map = map.set('fooAddress', SafeFactory.oneOwnerSafe) map = map.set('barAddress', SafeFactory.twoOwnersSafe) - const reduxStore = { [SAFE_REDUCER_ID]: map, providers: undefined } + const reduxStore = { + [SAFE_REDUCER_ID]: map, + providers: undefined, + balances: undefined, + } // WHEN const safes = safesListSelector(reduxStore) diff --git a/src/store/index.js b/src/store/index.js index 57d1701e..5bf6ace5 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -5,6 +5,7 @@ import { combineReducers, createStore, applyMiddleware, compose, type Reducer, t import thunk from 'redux-thunk' import provider, { PROVIDER_REDUCER_ID, type State as ProviderState } from '~/wallets/store/reducer/provider' import safe, { SAFE_REDUCER_ID, calculateInitialState, type State as SafeState } from '~/routes/safe/store/reducer/safe' +import balances, { BALANCE_REDUCER_ID, type State as BalancesState } from '~/routes/safe/store/reducer/balances' export const history = createBrowserHistory() @@ -18,12 +19,14 @@ const finalCreateStore = composeEnhancers(applyMiddleware( export type GlobalState = { providers: ProviderState, safes: SafeState, + balances: BalancesState, } const reducers: Reducer = combineReducers({ routing: routerReducer, [PROVIDER_REDUCER_ID]: provider, [SAFE_REDUCER_ID]: safe, + [BALANCE_REDUCER_ID]: balances, }) const initialState = { [SAFE_REDUCER_ID]: calculateInitialState() }