diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-05-13 11:53:40 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-05-14 12:46:12 +0800 |
commit | 0bcfbc15446b01b3b87233715cd3ead42d2730e4 (patch) | |
tree | 8b39abffed694538464ff00c2471fdc0df25ecd8 /test/integration | |
parent | 6bd1b21d3b8f74c44214f814c3fe1c8770ab9e2d (diff) | |
download | tangerine-wallet-browser-0bcfbc15446b01b3b87233715cd3ead42d2730e4.tar tangerine-wallet-browser-0bcfbc15446b01b3b87233715cd3ead42d2730e4.tar.gz tangerine-wallet-browser-0bcfbc15446b01b3b87233715cd3ead42d2730e4.tar.bz2 tangerine-wallet-browser-0bcfbc15446b01b3b87233715cd3ead42d2730e4.tar.lz tangerine-wallet-browser-0bcfbc15446b01b3b87233715cd3ead42d2730e4.tar.xz tangerine-wallet-browser-0bcfbc15446b01b3b87233715cd3ead42d2730e4.tar.zst tangerine-wallet-browser-0bcfbc15446b01b3b87233715cd3ead42d2730e4.zip |
Add error message when passwords don't match in first time flow. Change input field styling in first time flow
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/lib/mascara-first-time.js | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/test/integration/lib/mascara-first-time.js b/test/integration/lib/mascara-first-time.js index d86703277..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] @@ -77,15 +83,8 @@ async function runFirstTimeUsageTest (assert, done) { pwBox2.focus() await timeout(1000) - // Used to set values on TextField input component - const nativeInputValueSetter = Object.getOwnPropertyDescriptor( - window.HTMLInputElement.prototype, 'value' - ).set - nativeInputValueSetter.call(pwBox2, PASSWORD) - - var ev2 = new Event('input', { bubbles: true}) - pwBox2.dispatchEvent(ev2) + pwBox2.dispatchEvent(new Event('input', { bubbles: true})) const createButton2 = (await findAsync(app, 'button[type="submit"]'))[0] createButton2.click() |