From 50af02e74bf8967232b97a43db4f3befb6939566 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Thu, 19 Apr 2018 01:03:51 -0230 Subject: Add test case for PreferencesController#setAccountLabel --- test/unit/preferences-controller-test.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/unit') diff --git a/test/unit/preferences-controller-test.js b/test/unit/preferences-controller-test.js index 4b40b1159..c613c68f9 100644 --- a/test/unit/preferences-controller-test.js +++ b/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 () { it('should return an empty list initially', async function () { await preferencesController.setSelectedAddress('0x7e57e2') -- cgit