aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-11-04 04:44:29 +0800
committerDan Finlay <dan@danfinlay.com>2016-11-04 04:44:29 +0800
commite0246975a7a40a72cc68fb3dbe5782c9c219fea2 (patch)
tree3970124bcecfd8f18d658dcaeb8a2f14c2c31c9a /test
parentbd2a429a85d27fc82e76115ec136640cbfecf9e1 (diff)
downloadtangerine-wallet-browser-e0246975a7a40a72cc68fb3dbe5782c9c219fea2.tar
tangerine-wallet-browser-e0246975a7a40a72cc68fb3dbe5782c9c219fea2.tar.gz
tangerine-wallet-browser-e0246975a7a40a72cc68fb3dbe5782c9c219fea2.tar.bz2
tangerine-wallet-browser-e0246975a7a40a72cc68fb3dbe5782c9c219fea2.tar.lz
tangerine-wallet-browser-e0246975a7a40a72cc68fb3dbe5782c9c219fea2.tar.xz
tangerine-wallet-browser-e0246975a7a40a72cc68fb3dbe5782c9c219fea2.tar.zst
tangerine-wallet-browser-e0246975a7a40a72cc68fb3dbe5782c9c219fea2.zip
Finish fixing nicknaming bug
Diffstat (limited to 'test')
-rw-r--r--test/unit/keyring-controller-test.js31
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])
+ })
+ })
+
})