Add test case for PreferencesController#setAccountLabel

feature/default_network_editable
Whymarrh Whitby 7 years ago
parent c54e4c7191
commit 50af02e74b
  1. 21
      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 () { describe('getTokens', function () {
it('should return an empty list initially', async function () { it('should return an empty list initially', async function () {
await preferencesController.setSelectedAddress('0x7e57e2') await preferencesController.setSelectedAddress('0x7e57e2')

Loading…
Cancel
Save