WA-238 Adding test handling exception when exceeding dailyLimit
This commit is contained in:
parent
4051852eda
commit
26815af91c
|
@ -0,0 +1,29 @@
|
||||||
|
// @flow
|
||||||
|
import { aNewStore } from '~/store'
|
||||||
|
import { addEtherTo } from '~/test/addEtherTo'
|
||||||
|
import { aDeployedSafe, executeWithdrawnOn } from '~/routes/safe/store/test/builder/deployedSafe.builder'
|
||||||
|
|
||||||
|
describe('Safe Blockchain Test', () => {
|
||||||
|
let store
|
||||||
|
beforeEach(async () => {
|
||||||
|
store = aNewStore()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('wihdrawn should return revert error if exceeded dailyLimit', async () => {
|
||||||
|
// GIVEN
|
||||||
|
const dailyLimitValue = 0.30
|
||||||
|
const safeAddress = await aDeployedSafe(store, dailyLimitValue)
|
||||||
|
await addEtherTo(safeAddress, '0.7')
|
||||||
|
const value = 0.15
|
||||||
|
|
||||||
|
// WHEN
|
||||||
|
await executeWithdrawnOn(safeAddress, value)
|
||||||
|
await executeWithdrawnOn(safeAddress, value)
|
||||||
|
|
||||||
|
// THEN
|
||||||
|
expect(executeWithdrawnOn(safeAddress, value)).rejects.toThrow('VM Exception while processing transaction: revert')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export default updateDailyLimitReducerTests
|
Loading…
Reference in New Issue