aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-02-02 09:44:06 +0800
committerGitHub <noreply@github.com>2017-02-02 09:44:06 +0800
commit6df15177c8ea2029dc169ee18b5b54be0b66f97b (patch)
tree7f240dbe772618a83f7c1ce795390c7c4afbdd3c
parent2d99fc95280954d6464e66e87e0a9077718c2827 (diff)
parentdacbf16fe2b2a865fcbb1fd15236efdba525c015 (diff)
downloadtangerine-wallet-browser-6df15177c8ea2029dc169ee18b5b54be0b66f97b.tar.gz
tangerine-wallet-browser-6df15177c8ea2029dc169ee18b5b54be0b66f97b.tar.zst
tangerine-wallet-browser-6df15177c8ea2029dc169ee18b5b54be0b66f97b.zip
Merge pull request #1079 from MetaMask/kumavis-refactor5
Refactor round 5
-rw-r--r--app/scripts/keyring-controller.js1
-rw-r--r--app/scripts/metamask-controller.js1
-rw-r--r--development/states/first-time.json2
-rw-r--r--mock-dev.js1
-rw-r--r--test/integration/lib/first-time.js40
5 files changed, 23 insertions, 22 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index e2752831a..d1d706165 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -82,7 +82,6 @@ class KeyringController extends EventEmitter {
keyrings: memState.keyrings,
// configManager
seedWords: this.configManager.getSeedWords(),
- isDisclaimerConfirmed: this.configManager.getConfirmedDisclaimer(),
}
return result
}
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index fb5234c24..a56203a88 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -189,6 +189,7 @@ module.exports = class MetamaskController extends EventEmitter {
currentFiat: this.configManager.getCurrentFiat(),
conversionRate: this.configManager.getConversionRate(),
conversionDate: this.configManager.getConversionDate(),
+ isDisclaimerConfirmed: this.configManager.getConfirmedDisclaimer(),
}
)
}
diff --git a/development/states/first-time.json b/development/states/first-time.json
index d6d95fe06..598adc4cb 100644
--- a/development/states/first-time.json
+++ b/development/states/first-time.json
@@ -11,7 +11,7 @@
"network": null,
"accounts": {},
"transactions": [],
- "isDisclaimerConfirmed": true,
+ "isDisclaimerConfirmed": false,
"unconfMsgs": {},
"messages": [],
"shapeShiftTxList": [],
diff --git a/mock-dev.js b/mock-dev.js
index b20c3be3a..6563964c3 100644
--- a/mock-dev.js
+++ b/mock-dev.js
@@ -62,6 +62,7 @@ const controller = new MetamaskController({
// initial state
initState: firstTimeState,
})
+global.metamaskController = controller
//
// User Interface
diff --git a/test/integration/lib/first-time.js b/test/integration/lib/first-time.js
index 777fcbb7e..6e75eb6d7 100644
--- a/test/integration/lib/first-time.js
+++ b/test/integration/lib/first-time.js
@@ -8,49 +8,49 @@ QUnit.test('agree to terms', function (assert) {
wait().then(function() {
app = $('iframe').contents().find('#app-content .mock-app-root')
- app.find('.markdown').prop('scrollTop', 100000000)
+
+ // Scroll through terms
+ var termsHeader = app.find('h3.terms-header')[0]
+ assert.equal(termsHeader.textContent, 'MetaMask Terms & Conditions', 'Showing TOS')
+ let termsPage = app.find('.markdown')[0]
+ assert.ok(termsPage, 'on terms page')
+ termsPage.scrollTop = termsPage.scrollHeight
+
return wait()
+ }).then(function() {
+
+ // Agree to terms
+ var button = app.find('button')[0]
+ button.click()
+ return wait()
}).then(function() {
var title = app.find('h1').text()
assert.equal(title, 'MetaMask', 'title screen')
+ // enter password
var pwBox = app.find('#password-box')[0]
var confBox = app.find('#password-box-confirm')[0]
-
pwBox.value = PASSWORD
confBox.value = PASSWORD
+
return wait()
-
}).then(function() {
+ // create vault
var createButton = app.find('button.primary')[0]
createButton.click()
return wait(1500)
}).then(function() {
- var terms = app.find('h3.terms-header')[0]
- assert.equal(terms.textContent, 'MetaMask Terms & Conditions', 'Showing TOS')
-
- // Scroll through terms
- var scrollable = app.find('.markdown')[0]
- scrollable.scrollTop = scrollable.scrollHeight
-
- return wait(10)
- }).then(function() {
-
- var button = app.find('button')[0] // Agree button
- button.click()
-
- return wait(1000)
- }).then(function() {
-
var created = app.find('h3')[0]
assert.equal(created.textContent, 'Vault Created', 'Vault created screen')
- var button = app.find('button')[0] // Agree button
+ // Agree button
+ var button = app.find('button')[0]
+ assert.ok(button, 'button present')
button.click()
return wait(1000)