aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorbrunobar79 <brunobar79@gmail.com>2018-07-17 04:08:19 +0800
committerbrunobar79 <brunobar79@gmail.com>2018-07-17 04:08:19 +0800
commit41879a983582c832fe3b6b19df3c057a1cc13d2a (patch)
tree2eb7504dc474b29031c374af5764e554d313ad2b /test
parentde21a492655579b03da2b779058cfce1a3a2c9d3 (diff)
downloadtangerine-wallet-browser-41879a983582c832fe3b6b19df3c057a1cc13d2a.tar
tangerine-wallet-browser-41879a983582c832fe3b6b19df3c057a1cc13d2a.tar.gz
tangerine-wallet-browser-41879a983582c832fe3b6b19df3c057a1cc13d2a.tar.bz2
tangerine-wallet-browser-41879a983582c832fe3b6b19df3c057a1cc13d2a.tar.lz
tangerine-wallet-browser-41879a983582c832fe3b6b19df3c057a1cc13d2a.tar.xz
tangerine-wallet-browser-41879a983582c832fe3b6b19df3c057a1cc13d2a.tar.zst
tangerine-wallet-browser-41879a983582c832fe3b6b19df3c057a1cc13d2a.zip
added test for preferences controller
Diffstat (limited to 'test')
-rw-r--r--test/unit/app/controllers/preferences-controller-test.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/app/controllers/preferences-controller-test.js b/test/unit/app/controllers/preferences-controller-test.js
index e5e751b57..e055500b1 100644
--- a/test/unit/app/controllers/preferences-controller-test.js
+++ b/test/unit/app/controllers/preferences-controller-test.js
@@ -52,6 +52,31 @@ describe('preferences controller', function () {
})
})
+ describe('removeAddress', function () {
+ it('should remove an address from state', function () {
+ preferencesController.setAddresses([
+ '0xda22le',
+ '0x7e57e2',
+ ])
+
+ preferencesController.removeAddress('0xda22le')
+
+ assert.equal(preferencesController.store.getState().identities['0xda22le'], undefined)
+ })
+
+ it('should switch accounts if the selected address is removed', function () {
+ preferencesController.setAddresses([
+ '0xda22le',
+ '0x7e57e2',
+ ])
+
+ preferencesController.setSelectedAddress('0x7e57e2')
+ preferencesController.removeAddress('0x7e57e2')
+
+ assert.equal(preferencesController.getSelectedAddress(), '0xda22le')
+ })
+ })
+
describe('setAccountLabel', function () {
it('should update a label for the given account', function () {
preferencesController.setAddresses([