aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/tests/send-utils.test.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-19 00:37:01 +0800
committerDan <danjm.com@gmail.com>2018-06-19 00:37:01 +0800
commitac7c0277b503c7660d6894a9039d35c8713f52ab (patch)
tree8b7f3c762288d2b0aa3c9e4df117c4e30c106247 /ui/app/components/send_/tests/send-utils.test.js
parent70abe54c94d8c08aa1b73fd63f34b65bc3dff117 (diff)
downloadtangerine-wallet-browser-ac7c0277b503c7660d6894a9039d35c8713f52ab.tar
tangerine-wallet-browser-ac7c0277b503c7660d6894a9039d35c8713f52ab.tar.gz
tangerine-wallet-browser-ac7c0277b503c7660d6894a9039d35c8713f52ab.tar.bz2
tangerine-wallet-browser-ac7c0277b503c7660d6894a9039d35c8713f52ab.tar.lz
tangerine-wallet-browser-ac7c0277b503c7660d6894a9039d35c8713f52ab.tar.xz
tangerine-wallet-browser-ac7c0277b503c7660d6894a9039d35c8713f52ab.tar.zst
tangerine-wallet-browser-ac7c0277b503c7660d6894a9039d35c8713f52ab.zip
On send screen amount change, updateGas call now includes current to address.
Diffstat (limited to 'ui/app/components/send_/tests/send-utils.test.js')
-rw-r--r--ui/app/components/send_/tests/send-utils.test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/app/components/send_/tests/send-utils.test.js b/ui/app/components/send_/tests/send-utils.test.js
index facc0e518..f3d5674b7 100644
--- a/ui/app/components/send_/tests/send-utils.test.js
+++ b/ui/app/components/send_/tests/send-utils.test.js
@@ -48,6 +48,7 @@ const {
estimateGasPriceFromRecentBlocks,
generateTokenTransferData,
getAmountErrorObject,
+ getToAddressForGasUpdate,
calcTokenBalance,
isBalanceSufficient,
isTokenBalanceSufficient,
@@ -421,4 +422,15 @@ describe('send utils', () => {
assert.equal(estimateGasPriceFromRecentBlocks(mockRecentBlocks), '0x5')
})
})
+
+ describe('getToAddressForGasUpdate()', () => {
+ it('should return empty string if all params are undefined or null', () => {
+ assert.equal(getToAddressForGasUpdate(undefined, null), '')
+ })
+
+ it('should return the first string that is not defined or null in lower case', () => {
+ assert.equal(getToAddressForGasUpdate('A', null), 'a')
+ assert.equal(getToAddressForGasUpdate(undefined, 'B'), 'b')
+ })
+ })
})