Skip to content
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

Fix recipient field of approve screen #7171

Merged
merged 1 commit into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/e2e/contract-test/contract.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion test/e2e/metamask-ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ describe('MetaMask', function () {

const confirmDataDiv = await findElement(driver, By.css('.confirm-page-container-content__data-box'))
const confirmDataText = await confirmDataDiv.getText()
assert(confirmDataText.match(/0x095ea7b30000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c97/))
assert(confirmDataText.match(/0x095ea7b30000000000000000000000009bc5baf874d2da8d216ae9f137804184ee5afef4/))

const detailsTab = await findElement(driver, By.xpath(`//li[contains(text(), 'Details')]`))
detailsTab.click()
Expand Down Expand Up @@ -1280,6 +1280,12 @@ describe('MetaMask', function () {
assert.equal(await gasFeeInputs[0].getText(), '0.0006')
})

it('shows the correct recipient', async function () {
const senderToRecipientDivs = await findElements(driver, By.css('.sender-to-recipient__name'))
const recipientDiv = senderToRecipientDivs[1]
assert.equal(await recipientDiv.getText(), '0x9bc5...fEF4')
})

it('submits the transaction', async function () {
const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`))
await confirmButton.click()
Expand Down Expand Up @@ -1394,6 +1400,12 @@ describe('MetaMask', function () {
await delay(regularDelayMs)
})

it('shows the correct recipient', async function () {
const senderToRecipientDivs = await findElements(driver, By.css('.sender-to-recipient__name'))
const recipientDiv = senderToRecipientDivs[1]
assert.equal(await recipientDiv.getText(), 'Account 2')
})

it('submits the transaction', async function () {
await delay(regularDelayMs)
const confirmButton = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`))
Expand Down
2 changes: 1 addition & 1 deletion ui/app/helpers/utils/token-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ export function getTokenValue (tokenParams = []) {

export function getTokenToAddress (tokenParams = []) {
const toAddressData = tokenParams.find(param => param.name === '_to')
return toAddressData && toAddressData.value
return toAddressData ? toAddressData.value : tokenParams[0].value
}