aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/test/util/asset_data.test.ts
blob: cf247142ad8fbeea2ef6796142d0f8927bbd212b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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');
        });
    });
});