diff options
author | Fabio Berger <me@fabioberger.com> | 2018-10-18 18:36:41 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-10-18 18:36:41 +0800 |
commit | 28863f9a6f8a28ddbfe588b9e4d03b1e31da6961 (patch) | |
tree | db9bd874838a30ba82eacab0d4255fe3067eff94 /packages/instant/test/util/asset_data.test.ts | |
parent | 6ab6a9aa2b3511df60c078398168a84faf3e2385 (diff) | |
parent | cdd650d0eb83153a992922c6ffff35b494f299d3 (diff) | |
download | dexon-sol-tools-28863f9a6f8a28ddbfe588b9e4d03b1e31da6961.tar dexon-sol-tools-28863f9a6f8a28ddbfe588b9e4d03b1e31da6961.tar.gz dexon-sol-tools-28863f9a6f8a28ddbfe588b9e4d03b1e31da6961.tar.bz2 dexon-sol-tools-28863f9a6f8a28ddbfe588b9e4d03b1e31da6961.tar.lz dexon-sol-tools-28863f9a6f8a28ddbfe588b9e4d03b1e31da6961.tar.xz dexon-sol-tools-28863f9a6f8a28ddbfe588b9e4d03b1e31da6961.tar.zst dexon-sol-tools-28863f9a6f8a28ddbfe588b9e4d03b1e31da6961.zip |
merge dev-section-redesign
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'); + }); + }); +}); |