aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/test
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-02-05 19:32:59 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-02-05 19:32:59 +0800
commit400a97e7a8f76d894d47368425bbe1e33fa5b255 (patch)
treed84c0f68c60b6ab94cc546ac3fc94e3cd0825d99 /packages/0x.js/test
parenta816fb5958116127b1fffb78f5fca07624b5b0a5 (diff)
downloaddexon-sol-tools-400a97e7a8f76d894d47368425bbe1e33fa5b255.tar
dexon-sol-tools-400a97e7a8f76d894d47368425bbe1e33fa5b255.tar.gz
dexon-sol-tools-400a97e7a8f76d894d47368425bbe1e33fa5b255.tar.bz2
dexon-sol-tools-400a97e7a8f76d894d47368425bbe1e33fa5b255.tar.lz
dexon-sol-tools-400a97e7a8f76d894d47368425bbe1e33fa5b255.tar.xz
dexon-sol-tools-400a97e7a8f76d894d47368425bbe1e33fa5b255.tar.zst
dexon-sol-tools-400a97e7a8f76d894d47368425bbe1e33fa5b255.zip
Add regression tests
Diffstat (limited to 'packages/0x.js/test')
-rw-r--r--packages/0x.js/test/ether_token_wrapper_test.ts12
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);