aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/config-manager-test.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-05-21 07:18:54 +0800
committerDan Finlay <dan@danfinlay.com>2016-05-21 07:18:54 +0800
commit95a3cfe3fcffee2ffabd4cf71e568ae94693b10f (patch)
tree9c19992a823fb76a790cfdcbabb11ac1dc9b8fc1 /test/unit/config-manager-test.js
parent24fc5f9ea3a8cddfbf3993bdf0b18187a0787a64 (diff)
downloadtangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.gz
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.bz2
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.lz
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.xz
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.zst
tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.zip
Added ability to nickname wallets locally
The changes are persisted to localstorage, so they cannot be restored on a new computer, but for right now it's a nice organizational feature.
Diffstat (limited to 'test/unit/config-manager-test.js')
-rw-r--r--test/unit/config-manager-test.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/config-manager-test.js b/test/unit/config-manager-test.js
index e414ecb9e..aa94dc385 100644
--- a/test/unit/config-manager-test.js
+++ b/test/unit/config-manager-test.js
@@ -54,6 +54,27 @@ describe('config-manager', function() {
})
})
+ describe('wallet nicknames', function() {
+ it('should return null when no nicknames are saved', function() {
+ var nick = configManager.nicknameForWallet('0x0')
+ assert.equal(nick, null, 'no nickname returned')
+ })
+
+ it('should persist nicknames', function() {
+ var account = '0x0'
+ var nick1 = 'foo'
+ var nick2 = 'bar'
+ configManager.setNicknameForWallet(account, nick1)
+
+ var result1 = configManager.nicknameForWallet(account)
+ assert.equal(result1, nick1)
+
+ configManager.setNicknameForWallet(account, nick2)
+ var result2 = configManager.nicknameForWallet(account)
+ assert.equal(result2, nick2)
+ })
+ })
+
describe('rpc manipulations', function() {
it('changing rpc should return a different rpc', function() {
var firstRpc = 'first'