mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-08 07:01:04 +00:00
Format utils tests refactored 2
This commit is contained in:
parent
ced81e5503
commit
be3efd1835
@ -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', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user