-
Notifications
You must be signed in to change notification settings - Fork 5.4k
enable direct routing to the send page #15259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| if ( | ||
| draftTransactionExists === false || | ||
| stage === SEND_STAGES.ADD_RECIPIENT || | ||
| stage === SEND_STAGES.INACTIVE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you used .includes on line https://github.com/MetaMask/metamask-extension/pull/15259/files#diff-5fd11e9ad27369ac2d1e53fc158bc9fd26efaf0b9224509843ce70d141bd13bfR97, do you want to use it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, good call out. Done in latest
| // Ensure that the send flow renders on the add recipient screen when | ||
| // there is no draft transaction. | ||
| expect( | ||
| getByPlaceholderText('Search, public address (0x), or ENS'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we use this in another place but selecting elements by placeholder always feels kinda weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? This is a common way user's navigate forms... often times the placeholder text in inputs is more prominent or easier to reason about than the labels or the placeholder itself is the label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably just because I think of selecting elements by CSS paradigms, and you usually wouldn't select an element like this. It's fine, just breaks my brain a little.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The testing paradigm we should strive to emulate is one where we test our code how users interact with it. Instead of testing to see if internal values of a Counter class change when its addOne method is called, we should test that the on screen count increments when the user clicks the 'Add One' Button.
Builds ready [96f44f0]Page Load Metrics (1862 ± 57 ms)
highlights:storybook
|
adonesky1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Code looks good, and QA'd testing steps and issues linked
Explanation
When we refactored to not use global state for transaction data in the send flow, we made it a requirement to start a new draft transaction PRIOR to entering the send flow. This change allows us to gracefully handle situations that are edge cases such as when routing to the send screen directly, or if the user is in full screen mode and clicks back after moving to the confirm screen. Also added a test to cover this scenario.
More Information
Fixes #15188 #15183
Manual Testing Steps
Pre-Merge Checklist
+ If there are functional changes: