From 702b7568820d7a695f191df6bf44c76b37fdc7d8 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Fri, 31 Aug 2018 12:14:06 -0700 Subject: Allow denominations in CurrencyDisplay component --- .../tests/currency-display.container.test.js | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'ui/app/components/currency-display/tests') 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 474ce5378..5265bbb04 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 @@ -51,6 +51,50 @@ describe('CurrencyDisplay container', () => { displayValue: '1.266 ETH', }, }, + { + props: { + value: '0x1193461d01595930', + currency: 'ETH', + numberOfDecimals: 3, + hideLabel: true, + }, + result: { + displayValue: '1.266', + }, + }, + { + props: { + value: '0x3b9aca00', + currency: 'ETH', + denomination: 'GWEI', + hideLabel: true, + }, + result: { + displayValue: '1', + }, + }, + { + props: { + value: '0x3b9aca00', + currency: 'ETH', + denomination: 'WEI', + hideLabel: true, + }, + result: { + displayValue: '1000000000', + }, + }, + { + props: { + value: '0x3b9aca00', + currency: 'ETH', + numberOfDecimals: 100, + hideLabel: true, + }, + result: { + displayValue: '1e-9', + }, + }, ] tests.forEach(({ props, result }) => { -- cgit