diff options
author | Esteban MiƱo <efmino@uc.cl> | 2018-07-21 08:09:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-21 08:09:37 +0800 |
commit | 110efa9ec1525b5fd925de5a0d9350c40823464b (patch) | |
tree | 3cfe09a52c4c6b86ced28a32c2190ccf5c3084a2 /test/unit/app/controllers/preferences-controller-test.js | |
parent | 9c955549338f49d8b5eb6ca003c2c65c725aa328 (diff) | |
parent | e094d4ad1fb84a9bc663c328d0650bd9d8bf8716 (diff) | |
download | tangerine-wallet-browser-110efa9ec1525b5fd925de5a0d9350c40823464b.tar.gz tangerine-wallet-browser-110efa9ec1525b5fd925de5a0d9350c40823464b.tar.zst tangerine-wallet-browser-110efa9ec1525b5fd925de5a0d9350c40823464b.zip |
Merge branch 'develop' into detectTokenFeature
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([ |