diff options
Diffstat (limited to 'test/exchange_transfer_simulator_test.ts')
-rw-r--r-- | test/exchange_transfer_simulator_test.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/exchange_transfer_simulator_test.ts b/test/exchange_transfer_simulator_test.ts index 0331699c8..6ad2c007c 100644 --- a/test/exchange_transfer_simulator_test.ts +++ b/test/exchange_transfer_simulator_test.ts @@ -41,18 +41,18 @@ describe('ExchangeTransferSimulator', () => { beforeEach(() => { exchangeTransferSimulator = new ExchangeTransferSimulator(zeroEx.token); }); - it('throws if the user doesn\'t have enough balance', async () => { - return expect(exchangeTransferSimulator.transferFromAsync( - exampleTokenAddress, sender, recipient, transferAmount, TradeSide.Maker, TransferType.Trade, - )).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerBalance); - }); it('throws if the user doesn\'t have enough allowance', async () => { - txHash = await zeroEx.token.transferAsync(exampleTokenAddress, coinbase, sender, transferAmount); - await zeroEx.awaitTransactionMinedAsync(txHash); return expect(exchangeTransferSimulator.transferFromAsync( exampleTokenAddress, sender, recipient, transferAmount, TradeSide.Taker, TransferType.Trade, )).to.be.rejectedWith(ExchangeContractErrs.InsufficientTakerAllowance); }); + it('throws if the user doesn\'t have enough balance', async () => { + txHash = await zeroEx.token.setProxyAllowanceAsync(exampleTokenAddress, sender, transferAmount); + await zeroEx.awaitTransactionMinedAsync(txHash); + return expect(exchangeTransferSimulator.transferFromAsync( + exampleTokenAddress, sender, recipient, transferAmount, TradeSide.Maker, TransferType.Trade, + )).to.be.rejectedWith(ExchangeContractErrs.InsufficientMakerBalance); + }); it('updates balances and proxyAllowance after transfer', async () => { txHash = await zeroEx.token.transferAsync(exampleTokenAddress, coinbase, sender, transferAmount); await zeroEx.awaitTransactionMinedAsync(txHash); |