diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-05 19:32:59 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-05 19:32:59 +0800 |
commit | 400a97e7a8f76d894d47368425bbe1e33fa5b255 (patch) | |
tree | d84c0f68c60b6ab94cc546ac3fc94e3cd0825d99 /packages/0x.js | |
parent | a816fb5958116127b1fffb78f5fca07624b5b0a5 (diff) | |
download | dexon-sol-tools-400a97e7a8f76d894d47368425bbe1e33fa5b255.tar.gz dexon-sol-tools-400a97e7a8f76d894d47368425bbe1e33fa5b255.tar.zst dexon-sol-tools-400a97e7a8f76d894d47368425bbe1e33fa5b255.zip |
Add regression tests
Diffstat (limited to 'packages/0x.js')
-rw-r--r-- | packages/0x.js/test/ether_token_wrapper_test.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/0x.js/test/ether_token_wrapper_test.ts b/packages/0x.js/test/ether_token_wrapper_test.ts index 98e6981fd..145f11bd1 100644 --- a/packages/0x.js/test/ether_token_wrapper_test.ts +++ b/packages/0x.js/test/ether_token_wrapper_test.ts @@ -71,6 +71,18 @@ describe('EtherTokenWrapper', () => { afterEach(async () => { await blockchainLifecycle.revertAsync(); }); + describe('#getContractAddressIfExists', async () => { + it('should return contract address if connected to a known network', () => { + const contractAddressIfExists = zeroEx.etherToken.getContractAddressIfExists(); + expect(contractAddressIfExists).to.not.be.undefined(); + }); + it('should return undefined if connected to an unknown network', () => { + const UNKNOWN_NETWORK_NETWORK_ID = 10; + const unknownNetworkZeroEx = new ZeroEx(web3.currentProvider, { networkId: UNKNOWN_NETWORK_NETWORK_ID }); + const contractAddressIfExists = unknownNetworkZeroEx.etherToken.getContractAddressIfExists(); + expect(contractAddressIfExists).to.be.undefined(); + }); + }); describe('#depositAsync', () => { it('should successfully deposit ETH and issue Wrapped ETH tokens', async () => { const preETHBalance = await (zeroEx as any)._web3Wrapper.getBalanceInWeiAsync(addressWithETH); |