From d088dcdd36ddab32568bd8b71fb59cb59e52acc2 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 22 Jun 2017 00:16:35 +0200 Subject: Add simple test checking that fillOrderAsync return filled amount --- test/exchange_wrapper_test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index 6425e308a..cda2d4435 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -340,6 +340,16 @@ describe('ExchangeWrapper', () => { .to.be.bignumber.equal(fillableAmount.minus(partialFillAmount)); }); it('should return filled amount', async () => { + const signedOrder = await fillScenarios.createFillableSignedOrderAsync( + makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, + ); + const partialFillAmount = new BigNumber(3); + const filledAmount = await zeroEx.exchange.fillOrderAsync( + signedOrder, partialFillAmount, shouldCheckTransfer, takerAddress); + expect(filledAmount).to.be.bignumber.equal(partialFillAmount); + }); + it('should return the partially filled amount \ + if the fill amount specified is greater then the amount available', async () => { const signedOrder = await fillScenarios.createFillableSignedOrderAsync( makerTokenAddress, takerTokenAddress, makerAddress, takerAddress, fillableAmount, ); -- cgit