Merge pull request #1511 from 0xProject/fix/asset-buyer/zero-amount-available-test

Fix expectedAmountAvailableToFill  test
This commit is contained in:
Steve Klebanoff
2019-01-15 13:04:55 -08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -168,7 +168,7 @@ describe('buyQuoteCalculator', () => {
}; };
testHelpers.expectInsufficientLiquidityError(expect, errorFunction, new BigNumber(1)); testHelpers.expectInsufficientLiquidityError(expect, errorFunction, new BigNumber(1));
}); });
it('should throw without amount available to fill if amount rounds to 0', () => { it('should throw with 0 available to fill if amount rounds to 0', () => {
const smallOrder = orderFactory.createSignedOrderFromPartial({ const smallOrder = orderFactory.createSignedOrderFromPartial({
makerAssetAmount: new BigNumber(1), makerAssetAmount: new BigNumber(1),
takerAssetAmount: new BigNumber(1), takerAssetAmount: new BigNumber(1),
@@ -184,7 +184,7 @@ describe('buyQuoteCalculator', () => {
false, false,
); );
}; };
testHelpers.expectInsufficientLiquidityError(expect, errorFunction, undefined); testHelpers.expectInsufficientLiquidityError(expect, errorFunction, new BigNumber(0));
}); });
}); });
it('should not throw if order is fillable', () => { it('should not throw if order is fillable', () => {

View File

@@ -6,7 +6,7 @@ export const testHelpers = {
expectInsufficientLiquidityError: ( expectInsufficientLiquidityError: (
expect: Chai.ExpectStatic, expect: Chai.ExpectStatic,
functionWhichTriggersError: () => void, functionWhichTriggersError: () => void,
expectedAmountAvailableToFill?: BigNumber, expectedAmountAvailableToFill: BigNumber,
): void => { ): void => {
let wasErrorThrown = false; let wasErrorThrown = false;
try { try {