1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Add test case for PreferencesController#setAccountLabel

This commit is contained in:
Whymarrh Whitby 2018-04-19 01:03:51 -02:30
parent c54e4c7191
commit 50af02e74b

View File

@ -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 () {
it('should return an empty list initially', async function () {
await preferencesController.setSelectedAddress('0x7e57e2')