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.
* feat(srp): add a quiz to the SRP reveal
* fixed the popover header centering
* lint fixes
* converted from `ui/components/ui/popover` to `ui/components/component-library/modal`
* responded to @darkwing review
* added unit tests
* renamed the folder to 'srp-quiz-modal'
* responded to Monte's review
* using i18n-helper in the test suite
* small improvement to JSXDict comments
* wrote a new webdriver.holdMouseDownOnElement() to assist with testing the "Hold to reveal SRP" button
* Updating layout and some storybook naming and migrating to tsx
* Apply suggestions from @georgewrmarshall
Co-authored-by: George Marshall <george.marshall@consensys.net>
* Unit test searches by data-testid instead of by text
* new layout and copy for the Settings->Security page
* now with 100% test coverage for /ui/pages/settings/security-tab
fixes#16871fixes#18140
* e2e tests to reveal SRP after quiz
* e2e- Fix lint, remove unneeded extras
* @coreyjanssen and @georgewrmarshall compromise
Co-authored-by: George Marshall <george.marshall@consensys.net>
Co-authored-by: Corey Janssen <corey.janssen@consensys.net>
* trying isRequired again
* transparent background on PNG
* [e2e] moving functions to helpers and adding testid for SRP reveal quiz (#19481)
* moving functions to helpers and adding testid
* fix lint error
* took out the IPFS gateway fixes
* lint fix
* translations of SRP Reveal Quiz
* new Spanish translation from Guto
* Update describe for e2e tests
* Apply suggestion from @georgewrmarshall
Co-authored-by: George Marshall <george.marshall@consensys.net>
* fixed the Tab key problem
---------
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
Co-authored-by: Plasma Corral <32695229+plasmacorral@users.noreply.github.com>
Co-authored-by: Corey Janssen <corey.janssen@consensys.net>
* feat: add new linea mainnet network
* fix: removed unused condition + lint code
* fix: update tests + fix network tab issue
* feat: add feature toggle for linea mainnet
* fix: add feature toggle for linea mainnet
* feat: add linea mainnet logo
* update @metamask/eth-json-rpc-infura package to support linea networks
* update linea mainnet block explorer url
* fix: refactor linea mainnet feature toggle
* fix: update linea mainnet chain id and rpc url
* fix: update settings-search unit test
* fix: update linea mainnet feature flag
* fix: remove useless async function keyword for linea mainnet feature flag
* update account list menu to use ds popover and fix accessibility issue
* close popover if user continues to tab to next items
* remove disable logic not doing anything
* add stylesheet
* add refs to track last menuitem
* cleaned up ref version for MenuItems
* fix test
* add click away option and fix test
* fix e2e test
* undo e2e test
* add account e2e
* fix click outside component
* remove additional line break
* remove commented out code
* add isOpen to story
* set width to 225px
* fix: refactor linea goerli testnet implementation
* fix: rename linea goerli network
* feat: add linea testnet logo
* update linea goerli block explorer url
* update @metamask/eth-json-rpc-infura package to version 8.1.0
* fix: refactor ticker map object in shared/constants/networks.ts files
* UX: Multichain: Move Add Account and Import Account into Account Menu Popover
* Create a new CreateAccount component for the Account Menu
* Add actions for import form
* Use separate actions for cancel vs. submit
* Fix jest tests
* Remove commented route navigation
* Accommodate for failing import
* Fix tests
* Remove routes for new account and import
* Remove old create account page
* Move import-account files to multichain directory
* Fix paths on the import files
* Remove deprecated component library variables
* Fix error property of add form
* Fix user-actions-benchmark
* Update `@metamask/gas-fee-controller` to v6
The `@metamask/address-book-controller` package has been updated to v3.
This version was part of the [core monorepo v53](MetaMask/core#1385)
release. The remaining packages released as part of v53 will be updated
in later PRs.
This release included a number of breaking changes, but most of them
do not affect the extension:
* Bump to Node 16
* The extension already uses Node.js v16
* The `getChainId` constructor parameter now expects a `Hex` return
type rather than a decimal string
* The extension was already passing in a `getChainId` parameter that
returned `Hex`
* The gas fee controller messenger now requires the
`NetworkController:stateChange` event instead of the
`NetworkController:providerConfigChange` event
* This does not apply if `onNetworkStateChange` and `getChainId` are
provided to the constructor, which is the case here.
* Update `@metamask/network-controller` dependency and peer dependency
* This dependency is only used for types, and none of the type
changes affect how the extension interacts with this controller.
The one change that did have an impact is that the constructor
parameter `onNetworkStateChange` now expects event handlers to be
passed the full network state.
Relates to #19271
* Ensure chainid always matches mainnet in test builds
This is a bit strange, but this is how the tests were setup previously.
* Fix accidental state mutation
* Remove hardcoded mainnet chain ID from test builds
Three e2e tests have been updated to fix a possible race condition
causing intermittent e2e test failures.
In each of the updated tests, the test checks the current network.
The check is performed as a two-step process: locate the current
network element, then check the text to ensure it's correct.
This fails when the test driver finds the element before it re-renders.
If the test runs too quickly, it compares the text before the switch
is shown on screen, and the test fails.
Instead the tests use the element locator to describe what they want.
This tells the test driver to keep looking until the conditions are
met, ensuring the test doesn't fail unless the network switch takes
longer than the default timeout (which should not happen).
This is a good example of why we should avoid using assertions on
elements in e2e tests. Express your assertions as locators instead to
make the test more resilient in the case where the test runs before the
next render.
* Add new snap header and footer to snap install
* Add new snap header and footer to snap result and snap update
* Fix loading state
* Fix lint
* Add required scrolling
* Adjust avatar component
* Apply new headers and footers to snaps confirmations
* Rename previous SnapAuthorship component to SnapAuthorshipExpanded
* Fix lint
* Fix font weight
* Fix fencing
* Fix a test
* Fix lint after rebase
* Fix E2E
* Fix locale lint
* Fix another E2E
* Fix test ID
* Address PR comments
* Better scroll button centering
* Address design comments
* Fix unit test
* Fix E2Es
* Update UI (for audit)
Revert yarn.lock change
Update e2e tests with new copy for a button
Make UI changes to custom Snap UI
Update UI on snap installation success page
Fix icon on installation success
Fix snap name font weight in installation page
Add UI changes for Snap installation failed page
Add new copy for snap installation screen
Update e2e tests OK button name
Update OK button names in e2e tests
Return previous functionality of update flow
Add error message handling for update screens
* Fix after rebase
* Fix messages.json update message
* Revert SCSS changes
* Refactor failed and success screen rendering
* Add Snaps privacy warning on snap install
Add snap install warning status to storage
Add storybook
Add test for snap-privacy-warning
Resolve button type issue
Fix popup display logic
Update fixture
Update popup information and read more handling
Replace deprecated button
Update unit test
* Update buttons and add cancel flow
* Refactoring (review 1)
* Add more unit tests
* feature(17901): fix address-book `Sends to an address book entry` e2e against MV3 build
* feature(17901): add balance guide for send-eth e2e as well
---------
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>