From d60991ec88fe88be4041eb4a9392df6dfc1aa973 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 10 Sep 2018 17:01:15 -0700 Subject: Delete ConfigManager, replacing its usages with PreferencesController --- .../app/controllers/metamask-controller-test.js | 34 ++++++++++------------ 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'test/unit/app/controllers/metamask-controller-test.js') diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js index 85c78fe1e..e7a28bedb 100644 --- a/test/unit/app/controllers/metamask-controller-test.js +++ b/test/unit/app/controllers/metamask-controller-test.js @@ -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) }) }) -- cgit v1.2.3 From c49d854b55b3efd34c7fd0414b76f7feaa2eec7c Mon Sep 17 00:00:00 2001 From: Dan Finlay <542863+danfinlay@users.noreply.github.com> Date: Thu, 4 Oct 2018 14:08:05 -0700 Subject: Increase suggested gas percentile to 65 (#5359) * Increase suggested gas percentile to 65 I keep submitting transactions then waiting a long time. Apparently 50th percentile isn't enough. * Update test for getGasPrice --- test/unit/app/controllers/metamask-controller-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/unit/app/controllers/metamask-controller-test.js') diff --git a/test/unit/app/controllers/metamask-controller-test.js b/test/unit/app/controllers/metamask-controller-test.js index e7a28bedb..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 }) -- cgit v1.2.3