aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/metamask-controller-test.js
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-10-17 02:01:54 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-10-17 02:01:54 +0800
commit13820b6cc1801a420f39cdfecd7ccb5309dc597b (patch)
treec79832d7077ab03e0afe0c322cb32b204865d8b5 /test/unit/app/controllers/metamask-controller-test.js
parenteeecee01540fbad50c4c463a3b1a54142a63f168 (diff)
parent07ab613d4c647e3fe554bc06eab8cfb833315a88 (diff)
downloadtangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.gz
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.bz2
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.lz
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.xz
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.tar.zst
tangerine-wallet-browser-13820b6cc1801a420f39cdfecd7ccb5309dc597b.zip
fix conflicts
Diffstat (limited to 'test/unit/app/controllers/metamask-controller-test.js')
-rw-r--r--test/unit/app/controllers/metamask-controller-test.js36
1 files changed, 16 insertions, 20 deletions
diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js
index 85c78fe1e..17be2c028 100644
--- a/test/unit/app/controllers/metamask-controller-test.js
+++ b/test/unit/app/controllers/metamask-controller-test.js
@@ -116,7 +116,7 @@ describe('MetaMaskController', function () {
}
const gasPrice = metamaskController.getGasPrice()
- assert.equal(gasPrice, '0x3b9aca00', 'accurately estimates 50th percentile accepted gas price')
+ assert.equal(gasPrice, '0x174876e800', 'accurately estimates 65th percentile accepted gas price')
metamaskController.recentBlocksController = realRecentBlocksController
})
@@ -584,22 +584,18 @@ describe('MetaMaskController', function () {
})
describe('#clearSeedWordCache', function () {
+ it('should set seed words to null', function (done) {
+ sandbox.stub(metamaskController.preferencesController, 'setSeedWords')
+ metamaskController.clearSeedWordCache((err) => {
+ if (err) {
+ done(err)
+ }
- it('should have set seed words', function () {
- metamaskController.configManager.setSeedWords('test words')
- const getConfigSeed = metamaskController.configManager.getSeedWords()
- assert.equal(getConfigSeed, 'test words')
- })
-
- it('should clear config seed phrase', function () {
- metamaskController.configManager.setSeedWords('test words')
- metamaskController.clearSeedWordCache((err, result) => {
- if (err) console.log(err)
+ assert.ok(metamaskController.preferencesController.setSeedWords.calledOnce)
+ assert.deepEqual(metamaskController.preferencesController.setSeedWords.args, [[null]])
+ done()
})
- const getConfigSeed = metamaskController.configManager.getSeedWords()
- assert.equal(getConfigSeed, null)
})
-
})
describe('#setCurrentLocale', function () {
@@ -793,24 +789,24 @@ describe('MetaMaskController', function () {
describe('#markAccountsFound', function () {
it('adds lost accounts to config manager data', function () {
metamaskController.markAccountsFound(noop)
- const configManagerData = metamaskController.configManager.getData()
- assert.deepEqual(configManagerData.lostAccounts, [])
+ const state = metamaskController.getState()
+ assert.deepEqual(state.lostAccounts, [])
})
})
describe('#markPasswordForgotten', function () {
it('adds and sets forgottenPassword to config data to true', function () {
metamaskController.markPasswordForgotten(noop)
- const configManagerData = metamaskController.configManager.getData()
- assert.equal(configManagerData.forgottenPassword, true)
+ const state = metamaskController.getState()
+ assert.equal(state.forgottenPassword, true)
})
})
describe('#unMarkPasswordForgotten', function () {
it('adds and sets forgottenPassword to config data to false', function () {
metamaskController.unMarkPasswordForgotten(noop)
- const configManagerData = metamaskController.configManager.getData()
- assert.equal(configManagerData.forgottenPassword, false)
+ const state = metamaskController.getState()
+ assert.equal(state.forgottenPassword, false)
})
})