1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00
metamask-extension/test/e2e
Elliot Winkler bd12ea733a
Fix autolock field to accept decimals in Firefox (#19653)
The autolock field on the Settings screen — the field that allows users
to set the duration that MetaMask will wait for until automatically
locking — does not always accept decimal numbers. This breaks the e2e
test for this feature as it attempts to set this field to "0.1".

More specifically, the React component responsible for this field passes
whatever the user inputs through the `Number` function immediately and
then uses this to repopulate the input. Therefore, if the user enters
"3" followed by a ".", `Number("3.")` will be called. This evaluates to
the number 3, and "3" becomes the new value of the field. As a result,
the "." can never be typed.

Curiously, this behavior only happens in Firefox; Chrome seems to
keep the "." in the input field when it's typed. This happens because
`onChange` event doesn't seem to get fired until a number is typed
*after* the ".". This may be due to underlying differences in the DOM
between Chrome and Firefox.

Regardless, always passing the input through `Number` creates other odd
behavior, such as the fact that the input can never be cleared (because
`Number("")` evaluates to 0).

This commit solves these problems by saving the "raw" version of the
user's input as well as the normalized version. The raw version is
always used to populate the input, whereas the normalized version is
saved in state.
2023-06-22 10:29:24 -06:00
..
import-utc-json E2e test fixtures (#16061) 2022-10-28 09:42:12 +01:00
mock-page-with-disallowed-iframe Fix e2e tests 2022-05-16 18:48:20 -02:30
mock-page-with-iframe Use externally hosted phishing warning page 2022-05-16 14:40:50 -02:30
mv3 Implement tests for multiple service worker restarts on the mv3 build (#19293) 2023-06-20 11:17:08 +01:00
mv3-perf-stats Capture all Error console.log events (#17710) 2023-02-23 14:27:36 +00:00
nft Extend wallet_watchAsset to support ERC721 and ERC1155 tokens (#19454) 2023-06-15 15:18:12 -05:00
restore Toggle option to enable/disable balance and Token rate checking for using third-party API (#16772) 2023-01-17 10:23:04 -05:00
seeder Extend wallet_watchAsset to support ERC721 and ERC1155 tokens (#19454) 2023-06-15 15:18:12 -05:00
send-eth-with-private-key-test chore: Adjust trailing whitespace (#15636) 2022-08-24 14:11:49 -05:00
snaps [FLASK] Rework Snaps headers and footers (#19442) 2023-06-07 15:18:49 +02:00
swaps Swaps UI update (#19169) 2023-06-15 20:17:21 +02:00
tests Fix autolock field to accept decimals in Firefox (#19653) 2023-06-22 10:29:24 -06:00
webdriver feat(srp): add a quiz to the SRP reveal (#19283) 2023-06-20 14:27:10 -04:00
.mocharc.js allow importing of typescript in E2E test suite (#17141) 2023-01-12 08:38:12 -06:00
benchmark.js Release MultiChain 0.5 (#18903) 2023-06-01 16:14:38 -05:00
e2e-mocha-setup.js allow importing of typescript in E2E test suite (#17141) 2023-01-12 08:38:12 -06:00
e2e-process-report.js e2e multiple reports (#17715) 2023-02-10 19:34:01 +00:00
fixture-builder.js feat: add new linea mainnet network (#19326) 2023-06-16 14:05:33 -02:30
fixture-server.js Use deployed contracts in fixtures (#18107) 2023-03-13 14:31:14 +00:00
ganache.js [e2e] Using ganache requests to getBalance and getAccounts (#18215) 2023-03-20 10:29:18 +01:00
helpers.js feat(srp): add a quiz to the SRP reveal (#19283) 2023-06-20 14:27:10 -04:00
lavamoat-stats.js E2e test fixtures (#16061) 2022-10-28 09:42:12 +01:00
metamask-ui.spec.js Send flow UI update (#19465) 2023-06-08 22:39:39 +05:30
mock-e2e.js Update @metamask/gas-fee-controller to v6 (#19366) 2023-06-13 12:13:13 -02:30
mv3-stats.js E2e test fixtures (#16061) 2022-10-28 09:42:12 +01:00
phishing-warning-page-server.js Use externally hosted phishing warning page 2022-05-16 14:40:50 -02:30
run-all.js Move nft e2e tests to main e2e test job (#18055) 2023-03-14 15:21:24 +00:00
run-e2e-test.js Add desktop support (#17683) 2023-02-20 17:13:12 +00:00
user-actions-benchmark.js Fix #19609 - Prevent rounded corners in account menu (#19615) 2023-06-20 08:38:24 -05:00