diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-11-19 07:40:12 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-11-19 07:40:12 +0800 |
commit | 3cd839d27f78d9e59248a85be72a31cff9a3404c (patch) | |
tree | 8061d656b3572df624f76282ef4b190e21b8e0d9 /test/integration/lib | |
parent | bef023fb4a699c16fe0fff30ce18840678ed7ad0 (diff) | |
download | tangerine-wallet-browser-3cd839d27f78d9e59248a85be72a31cff9a3404c.tar tangerine-wallet-browser-3cd839d27f78d9e59248a85be72a31cff9a3404c.tar.gz tangerine-wallet-browser-3cd839d27f78d9e59248a85be72a31cff9a3404c.tar.bz2 tangerine-wallet-browser-3cd839d27f78d9e59248a85be72a31cff9a3404c.tar.lz tangerine-wallet-browser-3cd839d27f78d9e59248a85be72a31cff9a3404c.tar.xz tangerine-wallet-browser-3cd839d27f78d9e59248a85be72a31cff9a3404c.tar.zst tangerine-wallet-browser-3cd839d27f78d9e59248a85be72a31cff9a3404c.zip |
Create failing test to check submitPassword in keyringController.
Diffstat (limited to 'test/integration/lib')
-rw-r--r-- | test/integration/lib/keyring-controller-test.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/integration/lib/keyring-controller-test.js b/test/integration/lib/keyring-controller-test.js new file mode 100644 index 000000000..bea485270 --- /dev/null +++ b/test/integration/lib/keyring-controller-test.js @@ -0,0 +1,46 @@ +var KeyringController = require('../../../app/scripts/keyring-controller') +var ConfigManager = require('../../../app/scripts/lib/config-manager') + +var oldStyleVault = require('../mocks/oldVault.json') + +var STORAGE_KEY = 'metamask-config' +var PASSWORD = '12345678' +var FIRST_ADDRESS = '0x4dd5d356c5A016A220bCD69e82e5AF680a430d00'.toLowerCase() + + +QUnit.module('Old Style Vaults', { + beforeEach: function () { + window.localStorage[STORAGE_KEY] = JSON.stringify(oldStyleVault) + + this.configManager = new ConfigManager({ + loadData: () => { return JSON.parse(window.localStorage[STORAGE_KEY]) }, + setData: (data) => { window.localStorage[STORAGE_KEY] = JSON.stringify(data) }, + }) + + this.keyringController = new KeyringController({ + configManager: this.configManager, + getNetwork: () => { return '2' }, + }) + + this.ethStore = { + addAccount: () => {}, + removeAccount: () => {}, + } + + this.keyringController.setStore(this.ethStore) + } +}) + +QUnit.test('keyringController:isInitialized', function (assert) { + assert.ok(this.keyringController.getState().isInitialized) +}) + +QUnit.test('keyringController:submitPassword', function (assert) { + var done = assert.async() + + this.keyringController.submitPassword(PASSWORD, (err, state) => { + assert.notOk(err) + assert.ok(state.identities[FIRST_ADDRESS]) + done() + }) +}) |