diff options
author | HackyMiner <hackyminer@gmail.com> | 2018-10-30 19:15:38 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-10-30 19:15:38 +0800 |
commit | ac079365e6b4cf8b19db127e6971fa694fa54fff (patch) | |
tree | 306ce43b3a1b7ccb08d364d371cbffc630ba4bfc /ui/app/components/currency-display/tests | |
parent | 73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f (diff) | |
download | tangerine-wallet-browser-ac079365e6b4cf8b19db127e6971fa694fa54fff.tar.gz tangerine-wallet-browser-ac079365e6b4cf8b19db127e6971fa694fa54fff.tar.zst tangerine-wallet-browser-ac079365e6b4cf8b19db127e6971fa694fa54fff.zip |
fixed currency-display (#5619)
* call getValueFromWeiHex() with fromCurrency=nativeCurrency
Diffstat (limited to 'ui/app/components/currency-display/tests')
-rw-r--r-- | ui/app/components/currency-display/tests/currency-display.container.test.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/app/components/currency-display/tests/currency-display.container.test.js b/ui/app/components/currency-display/tests/currency-display.container.test.js index fb6678776..0c886af50 100644 --- a/ui/app/components/currency-display/tests/currency-display.container.test.js +++ b/ui/app/components/currency-display/tests/currency-display.container.test.js @@ -20,12 +20,14 @@ describe('CurrencyDisplay container', () => { metamask: { conversionRate: 280.45, currentCurrency: 'usd', + nativeCurrency: 'ETH', }, } assert.deepEqual(mapStateToProps(mockState), { conversionRate: 280.45, currentCurrency: 'usd', + nativeCurrency: 'ETH', }) }) }) @@ -35,6 +37,7 @@ describe('CurrencyDisplay container', () => { const mockStateProps = { conversionRate: 280.45, currentCurrency: 'usd', + nativeCurrency: 'ETH', } const tests = [ @@ -43,40 +46,49 @@ describe('CurrencyDisplay container', () => { value: '0x2386f26fc10000', numberOfDecimals: 2, currency: 'usd', + nativeCurrency: 'ETH', }, result: { displayValue: '$2.80', suffix: 'USD', + nativeCurrency: 'ETH', }, }, { props: { value: '0x2386f26fc10000', + currency: 'usd', + nativeCurrency: 'ETH', }, result: { displayValue: '$2.80', suffix: 'USD', + nativeCurrency: 'ETH', }, }, { props: { value: '0x1193461d01595930', currency: 'ETH', + nativeCurrency: 'ETH', numberOfDecimals: 3, }, result: { displayValue: '1.266', suffix: 'ETH', + nativeCurrency: 'ETH', }, }, { props: { value: '0x1193461d01595930', currency: 'ETH', + nativeCurrency: 'ETH', numberOfDecimals: 3, hideLabel: true, }, result: { + nativeCurrency: 'ETH', displayValue: '1.266', suffix: undefined, }, @@ -85,10 +97,12 @@ describe('CurrencyDisplay container', () => { props: { value: '0x3b9aca00', currency: 'ETH', + nativeCurrency: 'ETH', denomination: 'GWEI', hideLabel: true, }, result: { + nativeCurrency: 'ETH', displayValue: '1', suffix: undefined, }, @@ -97,10 +111,12 @@ describe('CurrencyDisplay container', () => { props: { value: '0x3b9aca00', currency: 'ETH', + nativeCurrency: 'ETH', denomination: 'WEI', hideLabel: true, }, result: { + nativeCurrency: 'ETH', displayValue: '1000000000', suffix: undefined, }, @@ -109,10 +125,12 @@ describe('CurrencyDisplay container', () => { props: { value: '0x3b9aca00', currency: 'ETH', + nativeCurrency: 'ETH', numberOfDecimals: 100, hideLabel: true, }, result: { + nativeCurrency: 'ETH', displayValue: '1e-9', suffix: undefined, }, |