mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-28 23:06:37 +01:00
4f3fc95d50
* Use @metamask/eslint-config@1.1.0 * Use eslint-plugin-mocha@6.2.2 * Mark root ESLint config as root * Update Mocha ESLint rules with shared ESLint config
28 lines
686 B
JavaScript
28 lines
686 B
JavaScript
import assert from 'assert'
|
|
import {
|
|
calcMaxAmount,
|
|
} from '../amount-max-button.utils.js'
|
|
|
|
describe('amount-max-button utils', function () {
|
|
|
|
describe('calcMaxAmount()', function () {
|
|
it('should calculate the correct amount when no selectedToken defined', function () {
|
|
assert.deepEqual(calcMaxAmount({
|
|
balance: 'ffffff',
|
|
gasTotal: 'ff',
|
|
selectedToken: false,
|
|
}), 'ffff00')
|
|
})
|
|
|
|
it('should calculate the correct amount when a selectedToken is defined', function () {
|
|
assert.deepEqual(calcMaxAmount({
|
|
selectedToken: {
|
|
decimals: 10,
|
|
},
|
|
tokenBalance: '64',
|
|
}), 'e8d4a51000')
|
|
})
|
|
})
|
|
|
|
})
|