1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-12 04:37:13 +01:00
metamask-extension/ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-utils.test.js
Erik Marks 76a2a9bb8b
@metamask/eslint config@5.0.0 (#10358)
* @metamask/eslint-config@5.0.0
* Update eslintrc and prettierrc
* yarn lint:fix
2021-02-04 10:15:23 -08:00

30 lines
750 B
JavaScript

import assert from 'assert';
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 () {
assert.deepStrictEqual(
calcMaxAmount({
balance: 'ffffff',
gasTotal: 'ff',
sendToken: false,
}),
'ffff00',
);
});
it('should calculate the correct amount when a sendToken is defined', function () {
assert.deepStrictEqual(
calcMaxAmount({
sendToken: {
decimals: 10,
},
tokenBalance: '64',
}),
'e8d4a51000',
);
});
});
});