aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-18 05:19:18 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-18 05:44:40 +0800
commitf2f7598c0edcbef2a190595f835870c0b76af0cc (patch)
treea3690caed32b4db6271397fde02ff35b2435261f
parentae4f1a093a3d02f13e56716dca2383a42b6422ba (diff)
downloaddexon-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
-rw-r--r--packages/instant/test/util/asset_data.test.ts17
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');
+ });
+ });
+});