diff options
Diffstat (limited to 'test/exchange_wrapper_test.ts')
-rw-r--r-- | test/exchange_wrapper_test.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index 6a511e68d..1b97d7b05 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -643,6 +643,22 @@ describe('ExchangeWrapper', () => { ); })(); }); + it('Should receive the LogCancel event when an order is cancelled', (done: DoneCallback) => { + (async () => { + const subscriptionOpts: SubscriptionOpts = { + fromBlock: 0, + toBlock: 'latest', + }; + await zeroEx.exchange.subscribeAsync(ExchangeEvents.LogCancel, subscriptionOpts, + indexFilterValues, (err: Error, event: ContractEvent) => { + expect(err).to.be.null(); + expect(event).to.not.be.undefined(); + done(); + }); + const cancelTakerAmountInBaseUnits = new BigNumber(1); + await zeroEx.exchange.cancelOrderAsync(signedOrder, cancelTakerAmountInBaseUnits); + })(); + }); it('Outstanding subscriptions are cancelled when zeroEx.setProviderAsync called', (done: DoneCallback) => { (async () => { const subscriptionOpts: SubscriptionOpts = { |