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