mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 12:29:06 +01:00
added test for preferences controller
This commit is contained in:
parent
de21a49265
commit
41879a9835
@ -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([
|
||||
|
Loading…
Reference in New Issue
Block a user