diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index e62958513..b52f6d938 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -291,13 +291,12 @@ describe('MetaMask', function () { it('transitions to the confirm screen', async function () { // Continue to next screen - await driver.delay(largeDelayMs); + await driver.waitForElementNotPresent('.loading-overlay'); await driver.clickElement({ text: 'Next', tag: 'button' }); - await driver.delay(largeDelayMs); }); it('displays the token transfer data', async function () { - await driver.delay(largeDelayMs); + await driver.waitForElementNotPresent('.loading-overlay'); await driver.clickElement({ text: 'Hex', tag: 'button' }); await driver.delay(regularDelayMs); @@ -481,7 +480,7 @@ describe('MetaMask', function () { }); it('submits the transaction', async function () { - await driver.delay(largeDelayMs * 2); + await driver.waitForElementNotPresent('.loading-overlay'); await driver.clickElement({ text: 'Confirm', tag: 'button' }); await driver.delay(largeDelayMs * 2); }); diff --git a/ui/ducks/send/send.js b/ui/ducks/send/send.js index 97448b0dd..45a681eb9 100644 --- a/ui/ducks/send/send.js +++ b/ui/ducks/send/send.js @@ -2015,10 +2015,11 @@ export function updateSendAmount(amount) { * @param {object} payload - action payload * @param {string} payload.type - type of asset to send * @param {TokenDetails} [payload.details] - ERC20 details if sending TOKEN asset + * @param payload.skipComputeEstimatedGasLimit * @returns {ThunkAction} */ export function updateSendAsset( - { type, details: providedDetails }, + { type, details: providedDetails, skipComputeEstimatedGasLimit }, { initialAssetSet = false } = {}, ) { return async (dispatch, getState) => { @@ -2149,7 +2150,7 @@ export function updateSendAsset( await dispatch(actions.updateAsset({ asset, initialAssetSet })); } - if (initialAssetSet === false) { + if (initialAssetSet === false && !skipComputeEstimatedGasLimit) { await dispatch(computeEstimatedGasLimit()); } }; @@ -2393,6 +2394,7 @@ export function startNewDraftTransaction(asset) { updateSendAsset({ type: asset.type ?? AssetType.native, details: asset.details, + skipComputeEstimatedGasLimit: true, }), );