1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/test/e2e
Mark Stacey ba25d52670
Use AdvancedGasInputs in AdvancedTabContent (#7186)
* Use `AdvancedGasInputs` in `AdvancedTabContent`

The `AdvancedGasInputs` component was originally extracted from the
`AdvancedTabContent` component, duplicating much of the rendering
logic. They have since evolved separately, with bugs being fixed in one
place but not the other.

The inputs and outputs expected weren't exactly the same, as the
`AdvancedGasInputs` component converts the input custom gas price and
limit, and it converts them both in the setter methods as well.
The `GasModalPageContainer` had to be adjusted to avoid converting
these values multiple times.

Both components dealt with input debouncing separately, both in less
than ideal ways. `AdvancedTabContent` didn't debounce either field, but
it did debounce the check for whether the gas limit field was below the
minimum value. So if a less-than-minimum value was set, it would be
propogated upwards and could be saved if the user clicked 'Save'
quickly enough. After a second delay it would snap back to the minimum
value. The `AdvancedGasInputs` component debounced both fields, but
it would replace any gas limit below the minimum with the minimum
value. This led to a problem where a brief pause during typing would
reset the field to 21000.

The `AdvancedGasInputs` approach was chosen, except that it was
updated to no longer change the gas limit if it was below the minimum.
Instead it displays an error. Parent components were checked to ensure
they would detect the error case of the gas limit being set too low,
and prevent the form submission in those cases. Of the three parents,
one had already dealt with it correctly, one needed to convert the
gas limit from hex first, and another needed the gas limit check added.

Closes #6872

* Cleanup send components

Empty README files have been removed, and a mistake in the index file
for the send page has been corrected. The Gas Slider component class
name was updated as well; it looks like it was originally created from
`AdvancedTabContent`, so it still had that class name.
2019-10-23 09:23:15 -03:00
..
contract-test Fix recipient field of approve screen (#7171) 2019-09-16 17:05:21 -02:30
mock-3box 3box integration 2.0 (#6972) 2019-09-16 14:41:01 -02:30
send-eth-with-private-key-test I5849 incremental account security (#6874) 2019-08-02 01:27:26 -02:30
address-book.spec.js test:e2e - only overwrite window.fetch once per session 2019-09-10 23:10:24 +08:00
ethereum-on.spec.js lint fix 2019-09-11 00:11:49 +08:00
fetch-mocks.json test:e2e - rework fetch-mocks 2019-09-10 23:04:03 +08:00
from-import-ui.spec.js test:e2e - only overwrite window.fetch once per session 2019-09-10 23:10:24 +08:00
func.js Refactor first time flow, remove seed phrase from state (#5994) 2019-01-23 11:55:34 -03:30
helpers.js lint fix 2019-09-11 00:11:49 +08:00
incremental-security.spec.js test:e2e - only overwrite window.fetch once per session 2019-09-10 23:10:24 +08:00
metamask-responsive-ui.spec.js test:e2e - fix responsie argument 2019-09-10 23:43:59 +08:00
metamask-ui.spec.js Use AdvancedGasInputs in AdvancedTabContent (#7186) 2019-10-23 09:23:15 -03:00
run-all.sh 3box integration 2.0 (#6972) 2019-09-16 14:41:01 -02:30
run-web3.sh Replace deprecated shell-parallel with concurrently (#6807) 2019-07-09 14:09:31 -02:30
send-edit.spec.js Use AdvancedGasInputs in AdvancedTabContent (#7186) 2019-10-23 09:23:15 -03:00
threebox.spec.js Add advanced setting to enable editing nonce on confirmation screens (#7089) 2019-09-27 00:30:36 -04:00
web3.spec.js test:e2e - only overwrite window.fetch once per session 2019-09-10 23:10:24 +08:00