1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-04 23:14:56 +01:00
metamask-extension/ui/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.utils.test.js
2021-04-28 14:53:59 -05:00

27 lines
676 B
JavaScript

import { calcMaxAmount } from './amount-max-button.utils';
describe('amount-max-button utils', () => {
describe('calcMaxAmount()', () => {
it('should calculate the correct amount when no sendToken defined', () => {
expect(
calcMaxAmount({
balance: 'ffffff',
gasTotal: 'ff',
sendToken: false,
}),
).toStrictEqual('ffff00');
});
it('should calculate the correct amount when a sendToken is defined', () => {
expect(
calcMaxAmount({
sendToken: {
decimals: 10,
},
tokenBalance: '64',
}),
).toStrictEqual('e8d4a51000');
});
});
});