diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-12 05:16:09 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-12 08:54:57 +0800 |
commit | 6033c1a5d5f494d1ed27b00488ca458952341ae6 (patch) | |
tree | 17b53c7971047ca57b235c5351e972da721c09a4 /test/token_wrapper_test.ts | |
parent | 38fbf028a6699c7d8e853db4699a37cdf60e70c2 (diff) | |
download | dexon-0x-contracts-6033c1a5d5f494d1ed27b00488ca458952341ae6.tar.gz dexon-0x-contracts-6033c1a5d5f494d1ed27b00488ca458952341ae6.tar.zst dexon-0x-contracts-6033c1a5d5f494d1ed27b00488ca458952341ae6.zip |
Use PascalCase names as string enum keys
Diffstat (limited to 'test/token_wrapper_test.ts')
-rw-r--r-- | test/token_wrapper_test.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index 06e373bfa..19be27b93 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -64,15 +64,15 @@ describe('TokenWrapper', () => { const toAddress = coinbase; return expect(zeroEx.token.transferAsync( token.address, fromAddress, toAddress, transferAmount, - )).to.be.rejectedWith(ZeroExError.INSUFFICIENT_BALANCE_FOR_TRANSFER); + )).to.be.rejectedWith(ZeroExError.InsufficientBalanceForTransfer); }); - it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => { + it('should throw a ContractDoesNotExist error for a non-existent token contract', async () => { const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065'; const fromAddress = coinbase; const toAddress = coinbase; return expect(zeroEx.token.transferAsync( nonExistentTokenAddress, fromAddress, toAddress, transferAmount, - )).to.be.rejectedWith(ZeroExError.CONTRACT_DOES_NOT_EXIST); + )).to.be.rejectedWith(ZeroExError.ContractDoesNotExist); }); }); describe('#transferFromAsync', () => { @@ -97,7 +97,7 @@ describe('TokenWrapper', () => { return expect(zeroEx.token.transferFromAsync( token.address, fromAddress, toAddress, senderAddress, transferAmount, - )).to.be.rejectedWith(ZeroExError.INSUFFICIENT_ALLOWANCE_FOR_TRANSFER); + )).to.be.rejectedWith(ZeroExError.InsufficientAllowanceForTransfer); }); it('[regression] should fail to transfer tokens if set allowance for toAddress instead of senderAddress', async () => { @@ -108,7 +108,7 @@ describe('TokenWrapper', () => { return expect(zeroEx.token.transferFromAsync( token.address, fromAddress, toAddress, senderAddress, transferAmount, - )).to.be.rejectedWith(ZeroExError.INSUFFICIENT_ALLOWANCE_FOR_TRANSFER); + )).to.be.rejectedWith(ZeroExError.InsufficientAllowanceForTransfer); }); it('should fail to transfer tokens if fromAddress has insufficient balance', async () => { const fromAddress = addressWithoutFunds; @@ -124,7 +124,7 @@ describe('TokenWrapper', () => { return expect(zeroEx.token.transferFromAsync( token.address, fromAddress, toAddress, senderAddress, transferAmount, - )).to.be.rejectedWith(ZeroExError.INSUFFICIENT_BALANCE_FOR_TRANSFER); + )).to.be.rejectedWith(ZeroExError.InsufficientBalanceForTransfer); }); it('should successfully transfer tokens', async () => { const fromAddress = coinbase; @@ -140,12 +140,12 @@ describe('TokenWrapper', () => { const postBalance = await zeroEx.token.getBalanceAsync(token.address, toAddress); return expect(postBalance).to.be.bignumber.equal(transferAmount); }); - it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => { + it('should throw a ContractDoesNotExist error for a non-existent token contract', async () => { const fromAddress = coinbase; const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065'; return expect(zeroEx.token.transferFromAsync( nonExistentTokenAddress, fromAddress, toAddress, senderAddress, new BigNumber(42), - )).to.be.rejectedWith(ZeroExError.CONTRACT_DOES_NOT_EXIST); + )).to.be.rejectedWith(ZeroExError.ContractDoesNotExist); }); }); describe('#getBalanceAsync', () => { @@ -156,11 +156,11 @@ describe('TokenWrapper', () => { const expectedBalance = new BigNumber('100000000000000000000000000'); return expect(balance).to.be.bignumber.equal(expectedBalance); }); - it('should throw a CONTRACT_DOES_NOT_EXIST error for a non-existent token contract', async () => { + it('should throw a ContractDoesNotExist error for a non-existent token contract', async () => { const nonExistentTokenAddress = '0x9dd402f14d67e001d8efbe6583e51bf9706aa065'; const ownerAddress = coinbase; return expect(zeroEx.token.getBalanceAsync(nonExistentTokenAddress, ownerAddress)) - .to.be.rejectedWith(ZeroExError.CONTRACT_DOES_NOT_EXIST); + .to.be.rejectedWith(ZeroExError.ContractDoesNotExist); }); it('should return a balance of 0 for a non-existent owner address', async () => { const token = tokens[0]; |