diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2018-05-31 07:04:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-31 07:04:02 +0800 |
commit | dc5477be3cc62dff912a9447c702edab66200f02 (patch) | |
tree | 4c4c4293bfbc2a80812d231af9c7e22877cebfbd /test/integration/lib/mascara-first-time.js | |
parent | 5fc24930a7febd919ec6a8f6e9c14f2bac0ef2b2 (diff) | |
parent | e59f606adb65de85484b0fb258980543967ee5e1 (diff) | |
download | tangerine-wallet-browser-dc5477be3cc62dff912a9447c702edab66200f02.tar tangerine-wallet-browser-dc5477be3cc62dff912a9447c702edab66200f02.tar.gz tangerine-wallet-browser-dc5477be3cc62dff912a9447c702edab66200f02.tar.bz2 tangerine-wallet-browser-dc5477be3cc62dff912a9447c702edab66200f02.tar.lz tangerine-wallet-browser-dc5477be3cc62dff912a9447c702edab66200f02.tar.xz tangerine-wallet-browser-dc5477be3cc62dff912a9447c702edab66200f02.tar.zst tangerine-wallet-browser-dc5477be3cc62dff912a9447c702edab66200f02.zip |
Merge pull request #4408 from MetaMask/v4.7.0rc2
Version 4.7.0 - rc2
Diffstat (limited to 'test/integration/lib/mascara-first-time.js')
-rw-r--r-- | test/integration/lib/mascara-first-time.js | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/test/integration/lib/mascara-first-time.js b/test/integration/lib/mascara-first-time.js index 5e07ab0b4..f43a30c74 100644 --- a/test/integration/lib/mascara-first-time.js +++ b/test/integration/lib/mascara-first-time.js @@ -1,5 +1,4 @@ const PASSWORD = 'password123' -const reactTriggerChange = require('react-trigger-change') const { timeout, findAsync, @@ -11,6 +10,11 @@ async function runFirstTimeUsageTest (assert, done) { const app = await queryAsync($, '#app-content') + // Used to set values on TextField input component + const nativeInputValueSetter = Object.getOwnPropertyDescriptor( + window.HTMLInputElement.prototype, 'value' + ).set + await skipNotices(app) const welcomeButton = (await findAsync(app, '.welcome-screen__button'))[0] @@ -21,12 +25,14 @@ async function runFirstTimeUsageTest (assert, done) { assert.equal(title, 'Create Password', 'create password screen') // enter password - const pwBox = (await findAsync(app, '.first-time-flow__input'))[0] - const confBox = (await findAsync(app, '.first-time-flow__input'))[1] - pwBox.value = PASSWORD - confBox.value = PASSWORD - reactTriggerChange(pwBox) - reactTriggerChange(confBox) + const pwBox = (await findAsync(app, '#create-password'))[0] + const confBox = (await findAsync(app, '#confirm-password'))[0] + + nativeInputValueSetter.call(pwBox, PASSWORD) + pwBox.dispatchEvent(new Event('input', { bubbles: true})) + + nativeInputValueSetter.call(confBox, PASSWORD) + confBox.dispatchEvent(new Event('input', { bubbles: true})) // Create Password const createButton = (await findAsync(app, 'button.first-time-flow__button'))[0] @@ -71,10 +77,16 @@ async function runFirstTimeUsageTest (assert, done) { assert.ok(lock, 'Lock menu item found') lock.click() - const pwBox2 = (await findAsync(app, '#password-box'))[0] - pwBox2.value = PASSWORD + await timeout(1000) + + const pwBox2 = (await findAsync(app, '#password'))[0] + pwBox2.focus() + await timeout(1000) + + nativeInputValueSetter.call(pwBox2, PASSWORD) + pwBox2.dispatchEvent(new Event('input', { bubbles: true})) - const createButton2 = (await findAsync(app, 'button.primary'))[0] + const createButton2 = (await findAsync(app, 'button[type="submit"]'))[0] createButton2.click() const detail2 = (await findAsync(app, '.wallet-view'))[0] |