diff options
author | Kadinsky <kandinsky454@protonmail.ch> | 2018-10-18 18:12:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-18 18:12:24 +0800 |
commit | d0df0747217dca230aadbee72337d7111a1383e7 (patch) | |
tree | 4df7d1a0fd40f7e953af595ddac9f9b7c4aec0d3 /packages/instant/test/util/asset_data.test.ts | |
parent | 376034ac7e2053ea81aa637983d1f6a7e61588d9 (diff) | |
parent | 6ea386a7af89c1b8a4df94b656ae1772c29c1401 (diff) | |
download | dexon-0x-contracts-d0df0747217dca230aadbee72337d7111a1383e7.tar.gz dexon-0x-contracts-d0df0747217dca230aadbee72337d7111a1383e7.tar.zst dexon-0x-contracts-d0df0747217dca230aadbee72337d7111a1383e7.zip |
Merge pull request #1142 from 0xProject/feature/instant/asset-buyer-errors
[instant] Asset buyer errors
Diffstat (limited to 'packages/instant/test/util/asset_data.test.ts')
-rw-r--r-- | packages/instant/test/util/asset_data.test.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/instant/test/util/asset_data.test.ts b/packages/instant/test/util/asset_data.test.ts new file mode 100644 index 000000000..cf247142a --- /dev/null +++ b/packages/instant/test/util/asset_data.test.ts @@ -0,0 +1,17 @@ +import { assetDataUtil } from '../../src/util/asset_data'; + +const ZRX_ASSET_DATA = '0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498'; + +describe('assetDataUtil', () => { + describe('bestNameForAsset', () => { + it('should return default string if assetData is undefined', () => { + expect(assetDataUtil.bestNameForAsset(undefined, 'xyz')).toEqual('xyz'); + }); + it('should return default string if assetData isnt found', () => { + expect(assetDataUtil.bestNameForAsset('fake', 'mah default')).toEqual('mah default'); + }); + it('should return ZRX for ZRX assetData', () => { + expect(assetDataUtil.bestNameForAsset(ZRX_ASSET_DATA, 'mah default')).toEqual('ZRX'); + }); + }); +}); |