diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-18 05:19:18 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-18 05:44:40 +0800 |
commit | f2f7598c0edcbef2a190595f835870c0b76af0cc (patch) | |
tree | a3690caed32b4db6271397fde02ff35b2435261f /packages/instant/test | |
parent | ae4f1a093a3d02f13e56716dca2383a42b6422ba (diff) | |
download | dexon-sol-tools-f2f7598c0edcbef2a190595f835870c0b76af0cc.tar dexon-sol-tools-f2f7598c0edcbef2a190595f835870c0b76af0cc.tar.gz dexon-sol-tools-f2f7598c0edcbef2a190595f835870c0b76af0cc.tar.bz2 dexon-sol-tools-f2f7598c0edcbef2a190595f835870c0b76af0cc.tar.lz dexon-sol-tools-f2f7598c0edcbef2a190595f835870c0b76af0cc.tar.xz dexon-sol-tools-f2f7598c0edcbef2a190595f835870c0b76af0cc.tar.zst dexon-sol-tools-f2f7598c0edcbef2a190595f835870c0b76af0cc.zip |
asset data util tests
Diffstat (limited to 'packages/instant/test')
-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'); + }); + }); +}); |