WA-235 Adding threshold test for checking store is updated correctly

This commit is contained in:
apanizo 2018-06-06 10:13:59 +02:00
parent b70b70c5df
commit 13c1152c5b
2 changed files with 5 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import { makeOwner } from '~/routes/safe/store/model/owner'
import { type Safe, makeSafe } from '~/routes/safe/store/model/safe'
import { load, saveSafes, SAFES_KEY } from '~/utils/localStorage'
import { makeDailyLimit } from '~/routes/safe/store/model/dailyLimit'
import updateThreshold, { UPDATE_THRESHOLD } from '~/routes/safe/store/actions/updateThreshold'
export const SAFE_REDUCER_ID = 'safes'
@ -50,4 +51,6 @@ export default handleActions({
},
[UPDATE_DAILY_LIMIT]: (state: State, action: ActionType<typeof updateDailyLimit>): State =>
state.updateIn([action.payload.safeAddress, 'dailyLimit'], () => makeDailyLimit(action.payload.dailyLimit)),
[UPDATE_THRESHOLD]: (state: State, action: ActionType<typeof updateThreshold>): State =>
state.updateIn([action.payload.safeAddress, 'confirmations'], () => action.payload.threshold),
}, Map())

View File

@ -2,6 +2,7 @@
import balanceReducerTests from './balance.reducer'
import safeReducerTests from './safe.reducer'
import dailyLimitReducerTests from './dailyLimit.reducer'
import thresholdReducerTests from './threshold.reducer'
import balanceSelectorTests from './balance.selector'
import safeSelectorTests from './safe.selector'
import grantedSelectorTests from './granted.selector'
@ -13,6 +14,7 @@ describe('Safe Test suite', () => {
safeReducerTests()
balanceReducerTests()
dailyLimitReducerTests()
thresholdReducerTests()
// SAFE SELECTOR
safeSelectorTests()