diff options
author | Csaba S <csaba.solya@gmail.com> | 2018-07-21 02:09:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-21 02:09:57 +0800 |
commit | c11dea9afc9f4215529abda11a0d5a7e4fdd10d4 (patch) | |
tree | 9a21c102490c3a9c751c606008d1e0c10b20cdc2 /test/unit/app/controllers/preferences-controller-test.js | |
parent | 682d59cfe0114dc987fe5e953e9db4dca5e2b5d7 (diff) | |
parent | cb045fd8feec88bd631329ab9b3285aeed0f2e97 (diff) | |
download | tangerine-wallet-browser-c11dea9afc9f4215529abda11a0d5a7e4fdd10d4.tar.gz tangerine-wallet-browser-c11dea9afc9f4215529abda11a0d5a7e4fdd10d4.tar.zst tangerine-wallet-browser-c11dea9afc9f4215529abda11a0d5a7e4fdd10d4.zip |
Merge branch 'develop' into transaction-notifications
Diffstat (limited to 'test/unit/app/controllers/preferences-controller-test.js')
-rw-r--r-- | test/unit/app/controllers/preferences-controller-test.js | 25 |
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([ |