1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Fix inputs that should allow decimals (#16254)

* Fix inputs that should allow decimals

* Update e2e test to cover inputting of decimals in advanced fields

* Update e2e test to cover inputting of decimals in advanced fields

* Fix e2e tests
This commit is contained in:
Dan J Miller 2022-10-25 00:25:31 -02:30 committed by seaona
parent 5fa841aa46
commit c6be223781
6 changed files with 11 additions and 4 deletions

View File

@ -123,10 +123,10 @@ describe('Editing Confirm Transaction', function () {
await driver.clickElement('[data-testid="edit-gas-fee-item-custom"]');
// enter max fee
await driver.fill('[data-testid="base-fee-input"]', '8');
await driver.fill('[data-testid="base-fee-input"]', '8.5');
// enter priority fee
await driver.fill('[data-testid="priority-fee-input"]', '8');
await driver.fill('[data-testid="priority-fee-input"]', '8.5');
// save default values
await driver.clickElement('input[type="checkbox"]');
@ -141,11 +141,11 @@ describe('Editing Confirm Transaction', function () {
// has correct updated value on the confirm screen the transaction
await driver.waitForSelector({
css: '.transaction-detail-item:nth-of-type(1) h6:nth-of-type(2)',
text: '0.0008 ETH',
text: '0.00085 ETH',
});
await driver.waitForSelector({
css: '.transaction-detail-item:nth-of-type(2) h6:nth-of-type(2)',
text: '2.2008 ETH',
text: '2.20085 ETH',
});
// confirms the transaction

View File

@ -71,6 +71,7 @@ export default function AdvancedGasControls({
value={maxPriorityFee}
detailText={maxPriorityFeeFiat}
numeric
allowDecimals
error={
gasErrors?.maxPriorityFee
? getGasFormErrorText(gasErrors.maxPriorityFee, t)
@ -87,6 +88,7 @@ export default function AdvancedGasControls({
}}
value={maxFee}
numeric
allowDecimals
detailText={maxFeeFiat}
error={
gasErrors?.maxFee
@ -107,6 +109,7 @@ export default function AdvancedGasControls({
tooltipText={t('editGasPriceTooltip')}
value={gasPrice}
numeric
allowDecimals
error={
gasErrors?.gasPrice
? getGasFormErrorText(gasErrors.gasPrice, t)

View File

@ -51,6 +51,7 @@ const AdvancedGasFeeGasLimit = () => {
onChange={updateGasLimit}
titleText={t('gasLimitV2')}
value={gasLimit}
allowDecimals={false}
numeric
/>
);

View File

@ -118,6 +118,7 @@ const BaseFeeInput = () => {
tooltipText={t('advancedBaseGasFeeToolTip')}
value={baseFee}
detailText={`${baseFeeInPrimaryCurrency}`}
allowDecimals
numeric
/>
<AdvancedGasFeeInputSubtext

View File

@ -111,6 +111,7 @@ const PriorityFeeInput = () => {
tooltipText={t('advancedPriorityFeeToolTip')}
value={priorityFee}
detailText={`${priorityFeeInPrimaryCurrency}`}
allowDecimals
numeric
/>
<AdvancedGasFeeInputSubtext

View File

@ -168,6 +168,7 @@ export default function CustomSpendingCap({
</button>
}
titleDetailWrapperProps={{ marginBottom: 2, marginRight: 0 }}
allowDecimals
/>
<Typography
color={COLORS.TEXT_DEFAULT}