aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-04-19 11:33:51 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-05-17 23:27:39 +0800
commit50af02e74bf8967232b97a43db4f3befb6939566 (patch)
tree84c9ca893ba35d2eb2dfb68a4cf8ad7085c5744b /test/unit
parentc54e4c719110c2033b7cc3757676f97ad3329d42 (diff)
downloadtangerine-wallet-browser-50af02e74bf8967232b97a43db4f3befb6939566.tar
tangerine-wallet-browser-50af02e74bf8967232b97a43db4f3befb6939566.tar.gz
tangerine-wallet-browser-50af02e74bf8967232b97a43db4f3befb6939566.tar.bz2
tangerine-wallet-browser-50af02e74bf8967232b97a43db4f3befb6939566.tar.lz
tangerine-wallet-browser-50af02e74bf8967232b97a43db4f3befb6939566.tar.xz
tangerine-wallet-browser-50af02e74bf8967232b97a43db4f3befb6939566.tar.zst
tangerine-wallet-browser-50af02e74bf8967232b97a43db4f3befb6939566.zip
Add test case for PreferencesController#setAccountLabel
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/preferences-controller-test.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/preferences-controller-test.js b/test/unit/preferences-controller-test.js
index 4b40b1159..c613c68f9 100644
--- a/test/unit/preferences-controller-test.js
+++ b/test/unit/preferences-controller-test.js
@@ -52,6 +52,27 @@ describe('preferences controller', function () {
})
})
+ describe('setAccountLabel', function () {
+ it('should update a label for the given account', function () {
+ preferencesController.setAddresses([
+ '0xda22le',
+ '0x7e57e2',
+ ])
+
+ assert.deepEqual(preferencesController.store.getState().identities['0xda22le'], {
+ name: 'Account 1',
+ address: '0xda22le',
+ })
+
+
+ preferencesController.setAccountLabel('0xda22le', 'Dazzle')
+ assert.deepEqual(preferencesController.store.getState().identities['0xda22le'], {
+ name: 'Dazzle',
+ address: '0xda22le',
+ })
+ })
+ })
+
describe('getTokens', function () {
it('should return an empty list initially', async function () {
await preferencesController.setSelectedAddress('0x7e57e2')