You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
662 B
28 lines
662 B
7 years ago
|
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,
|
||
|
},
|
||
6 years ago
|
tokenBalance: '64',
|
||
7 years ago
|
}), 'e8d4a51000')
|
||
|
})
|
||
|
})
|
||
|
|
||
|
})
|