aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js
diff options
context:
space:
mode:
authorPhyrexTsai <x01ep23i@hotmail.com>2018-07-04 09:06:10 +0800
committerGitHub <noreply@github.com>2018-07-04 09:06:10 +0800
commitf38dc03b27a457733315cbb16d59d0ea339505da (patch)
tree77cfdf13c0e83c8e6d87099bfedddc3d58667de1 /ui/app/components/send_/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js
parent11736e6318182ab5b43430410a46059e5f46ad52 (diff)
parent13b03ec090df70512d43e0d6acbe6bf60040a892 (diff)
downloadtangerine-wallet-browser-f38dc03b27a457733315cbb16d59d0ea339505da.tar.gz
tangerine-wallet-browser-f38dc03b27a457733315cbb16d59d0ea339505da.tar.zst
tangerine-wallet-browser-f38dc03b27a457733315cbb16d59d0ea339505da.zip
Merge pull request #4 from brunobar79/portal-metamask-lint-fix
Lint fix for Integration ENS with IPFS
Diffstat (limited to 'ui/app/components/send_/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js')
-rw-r--r--ui/app/components/send_/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/ui/app/components/send_/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js b/ui/app/components/send_/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js
new file mode 100644
index 000000000..816df6a12
--- /dev/null
+++ b/ui/app/components/send_/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js
@@ -0,0 +1,27 @@
+import assert from 'assert'
+import {
+ calcMaxAmount,
+} from '../amount-max-button.utils.js'
+
+describe('amount-max-button utils', () => {
+
+ describe('calcMaxAmount()', () => {
+ it('should calculate the correct amount when no selectedToken defined', () => {
+ assert.deepEqual(calcMaxAmount({
+ balance: 'ffffff',
+ gasTotal: 'ff',
+ selectedToken: false,
+ }), 'ffff00')
+ })
+
+ it('should calculate the correct amount when a selectedToken is defined', () => {
+ assert.deepEqual(calcMaxAmount({
+ selectedToken: {
+ decimals: 10,
+ },
+ tokenBalance: 100,
+ }), 'e8d4a51000')
+ })
+ })
+
+})