From be3efd183544bb2d51be50057c2ce4b240b85b33 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Mon, 25 Feb 2019 15:08:09 +0100 Subject: [PATCH] Format utils tests refactored 2 --- src/utils/__tests__/formatUtils.test.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/__tests__/formatUtils.test.js b/src/utils/__tests__/formatUtils.test.js index 2f9071d5..f83776e4 100644 --- a/src/utils/__tests__/formatUtils.test.js +++ b/src/utils/__tests__/formatUtils.test.js @@ -1,12 +1,13 @@ import * as utils from '../formatUtils'; describe('format utils', () => { + // TODO: check this weird function it('formatAmount', () => { - expect(utils.formatAmount(0, { isBitcoin: true }, 'mbtc')).toMatchSnapshot('0 btc'); - expect(utils.formatAmount(1000000, { isBitcoin: true }, 'mbtc')).toMatchSnapshot('10 mBTC'); - expect(utils.formatAmount(0.5, { isBitcoin: true }, 'mbtc')).toMatchSnapshot('0.000005 mBTC'); - expect(utils.formatAmount(1, { isBitcoin: false, shortcut: 'eth' }, null)).toMatchSnapshot('1e-8 eth'); - expect(utils.formatAmount(99999, { isBitcoin: false, shortcut: 'tau' }, null)).toMatchSnapshot('0.00099999 tau'); + expect(utils.formatAmount(0, { isBitcoin: false, shortcut: 'mbtc' }, 'mbtc')).toBe('0 mbtc'); + expect(utils.formatAmount(1000000, { isBitcoin: true }, 'mbtc')).toBe('10 mBTC'); + expect(utils.formatAmount(0.5, { isBitcoin: true }, 'mbtc')).toBe('0.000005 mBTC'); + expect(utils.formatAmount(1, { isBitcoin: false, shortcut: 'eth' }, null)).toBe('1e-8 eth'); + expect(utils.formatAmount(99999, { isBitcoin: false, shortcut: 'tau' }, null)).toBe('0.00099999 tau'); }); it('format time', () => {