diff options
Finish fixing nicknaming bug
Diffstat (limited to 'test/unit/keyring-controller-test.js')
-rw-r--r-- | test/unit/keyring-controller-test.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/unit/keyring-controller-test.js b/test/unit/keyring-controller-test.js index eed6af2c3..0076d9ebe 100644 --- a/test/unit/keyring-controller-test.js +++ b/test/unit/keyring-controller-test.js @@ -115,7 +115,38 @@ describe('KeyringController', function() { const persisted = keyringController.configManager.nicknameForWallet(account) assert.equal(persisted, nick) }) + + this.timeout(10000) + it('retrieves the persisted nickname', function(done) { + const account = addresses[0] + var nick = 'Test nickname' + keyringController.configManager.setNicknameForWallet(account, nick) + console.log('calling to restore') + keyringController.createNewVaultAndRestore(password, seedWords, (err, state) => { + console.dir({err}) + assert.ifError(err) + + const identity = keyringController.identities['0x' + account] + assert.equal(identity.name, nick) + + assert(accounts) + done() + }) + }) }) + + describe('#getAccounts', function() { + it('returns the result of getAccounts for each keyring', function() { + keyringController.keyrings = [ + { getAccounts() { return [1,2,3] } }, + { getAccounts() { return [4,5,6] } }, + ] + + const result = keyringController.getAccounts() + assert.deepEqual(result, [1,2,3,4,5,6]) + }) + }) + }) |