aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@users.noreply.github.com>2018-12-14 10:19:36 +0800
committerGitHub <noreply@github.com>2018-12-14 10:19:36 +0800
commit30a2be85eebe4f6b8cddb297f14faba392fe1133 (patch)
tree34cec0a1910e9e16bbed103d4b0f65f61724f8fb /test
parent435fdae84ac49b1366b8737215d97bd82002dccf (diff)
downloadtangerine-wallet-browser-30a2be85eebe4f6b8cddb297f14faba392fe1133.tar
tangerine-wallet-browser-30a2be85eebe4f6b8cddb297f14faba392fe1133.tar.gz
tangerine-wallet-browser-30a2be85eebe4f6b8cddb297f14faba392fe1133.tar.bz2
tangerine-wallet-browser-30a2be85eebe4f6b8cddb297f14faba392fe1133.tar.lz
tangerine-wallet-browser-30a2be85eebe4f6b8cddb297f14faba392fe1133.tar.xz
tangerine-wallet-browser-30a2be85eebe4f6b8cddb297f14faba392fe1133.tar.zst
tangerine-wallet-browser-30a2be85eebe4f6b8cddb297f14faba392fe1133.zip
Prevent users from changing the From field in the send screen (#5922)
* Prevent users from changing the From field in the send screen * Fix integration tests
Diffstat (limited to 'test')
-rw-r--r--test/integration/lib/send-new-ui.js25
1 files changed, 5 insertions, 20 deletions
diff --git a/test/integration/lib/send-new-ui.js b/test/integration/lib/send-new-ui.js
index 1acd85a35..145c9ad3b 100644
--- a/test/integration/lib/send-new-ui.js
+++ b/test/integration/lib/send-new-ui.js
@@ -54,23 +54,14 @@ async function runSendFlowTest (assert, done) {
const sendFromField = await queryAsync($, '.send-v2__form-field')
assert.ok(sendFromField[0], 'send screen has a from field')
- let sendFromFieldItemAddress = await queryAsync($, '.account-list-item__account-name')
- assert.equal(sendFromFieldItemAddress[0].textContent, 'Send Account 4', 'send from field shows correct account name')
-
- const sendFromFieldItem = await queryAsync($, '.account-list-item')
- sendFromFieldItem[0].click()
-
- // this seems to fail if the firefox window is not in focus...
- const sendFromDropdownList = await queryAsync($, '.send-v2__from-dropdown__list')
- assert.equal(sendFromDropdownList.children().length, 4, 'send from dropdown shows all accounts')
- sendFromDropdownList.children()[1].click()
-
- sendFromFieldItemAddress = await queryAsync($, '.account-list-item__account-name')
- assert.equal(sendFromFieldItemAddress[0].textContent, 'Send Account 2', 'send from field dropdown changes account name')
+ const sendFromFieldItemAddress = await queryAsync($, '.account-list-item__account-name')
+ assert.equal(sendFromFieldItemAddress[0].textContent, 'Send Account 2', 'send from field shows correct account name')
const sendToFieldInput = await queryAsync($, '.send-v2__to-autocomplete__input')
sendToFieldInput[0].focus()
+ await timeout(1000)
+
const sendToDropdownList = await queryAsync($, '.send-v2__from-dropdown__list')
assert.equal(sendToDropdownList.children().length, 5, 'send to dropdown shows all accounts and address book accounts')
@@ -104,7 +95,7 @@ async function runSendFlowTest (assert, done) {
reactTriggerChange(selectState[0])
const confirmFromName = (await queryAsync($, '.sender-to-recipient__name')).first()
- assert.equal(confirmFromName[0].textContent, 'Send Account 4', 'confirm screen should show correct from name')
+ assert.equal(confirmFromName[0].textContent, 'Send Account 2', 'confirm screen should show correct from name')
const confirmToName = (await queryAsync($, '.sender-to-recipient__name')).last()
assert.equal(confirmToName[0].textContent, 'Send Account 3', 'confirm screen should show correct to name')
@@ -118,12 +109,6 @@ async function runSendFlowTest (assert, done) {
const confirmScreenBackButton = await queryAsync($, '.confirm-page-container-header__back-button')
confirmScreenBackButton[0].click()
- const sendFromFieldItemInEdit = await queryAsync($, '.account-list-item')
- sendFromFieldItemInEdit[0].click()
-
- const sendFromDropdownListInEdit = await queryAsync($, '.send-v2__from-dropdown__list')
- sendFromDropdownListInEdit.children()[2].click()
-
const sendToFieldInputInEdit = await queryAsync($, '.send-v2__to-autocomplete__input')
sendToFieldInputInEdit[0].focus()
sendToFieldInputInEdit.val('0xd85a4b6a394794842887b8284293d69163007bbb')