1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +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 GitHub
parent 65e3047a74
commit 1526b14157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"]'); await driver.clickElement('[data-testid="edit-gas-fee-item-custom"]');
// enter max fee // 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 // 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 // save default values
await driver.clickElement('input[type="checkbox"]'); 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 // has correct updated value on the confirm screen the transaction
await driver.waitForSelector({ await driver.waitForSelector({
css: '.transaction-detail-item:nth-of-type(1) h6:nth-of-type(2)', css: '.transaction-detail-item:nth-of-type(1) h6:nth-of-type(2)',
text: '0.0008 ETH', text: '0.00085 ETH',
}); });
await driver.waitForSelector({ await driver.waitForSelector({
css: '.transaction-detail-item:nth-of-type(2) h6:nth-of-type(2)', css: '.transaction-detail-item:nth-of-type(2) h6:nth-of-type(2)',
text: '2.2008 ETH', text: '2.20085 ETH',
}); });
// confirms the transaction // confirms the transaction

View File

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

View File

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

View File

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

View File

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

View File

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