From 26815af91cb209b9e93883c575d3f8e6ee57f350 Mon Sep 17 00:00:00 2001 From: apanizo Date: Mon, 14 May 2018 10:42:42 +0200 Subject: [PATCH] WA-238 Adding test handling exception when exceeding dailyLimit --- .../component/Withdrawn/withdrawn.test.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/routes/safe/component/Withdrawn/withdrawn.test.js diff --git a/src/routes/safe/component/Withdrawn/withdrawn.test.js b/src/routes/safe/component/Withdrawn/withdrawn.test.js new file mode 100644 index 00000000..b5fafd1a --- /dev/null +++ b/src/routes/safe/component/Withdrawn/withdrawn.test.js @@ -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