mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
4c87c05a02
* Fix rounding issue when sending max tokens * Ensure amount row shows exact amount of max tokens on send screen (#2) * Fix tests * Change stored redux value from BigNumber to hex string. Fix TokenInput default value
28 lines
662 B
JavaScript
28 lines
662 B
JavaScript
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: '64',
|
|
}), 'e8d4a51000')
|
|
})
|
|
})
|
|
|
|
})
|