1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-20 00:13:22 +01:00
metamask-extension/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js

30 lines
730 B
JavaScript
Raw Normal View History

import assert from 'assert'
2020-11-03 00:41:28 +01:00
import { calcMaxAmount } from '../amount-max-button.utils'
describe('amount-max-button utils', function () {
describe('calcMaxAmount()', function () {
it('should calculate the correct amount when no sendToken defined', function () {
2020-11-03 00:41:28 +01:00
assert.deepEqual(
calcMaxAmount({
balance: 'ffffff',
gasTotal: 'ff',
sendToken: false,
}),
'ffff00',
)
})
it('should calculate the correct amount when a sendToken is defined', function () {
2020-11-03 00:41:28 +01:00
assert.deepEqual(
calcMaxAmount({
sendToken: {
decimals: 10,
},
tokenBalance: '64',
}),
'e8d4a51000',
)
})
})
})