diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-05-21 07:18:54 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-05-21 07:18:54 +0800 |
commit | 95a3cfe3fcffee2ffabd4cf71e568ae94693b10f (patch) | |
tree | 9c19992a823fb76a790cfdcbabb11ac1dc9b8fc1 /test/unit/actions | |
parent | 24fc5f9ea3a8cddfbf3993bdf0b18187a0787a64 (diff) | |
download | tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.gz tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.tar.zst tangerine-wallet-browser-95a3cfe3fcffee2ffabd4cf71e568ae94693b10f.zip |
Added ability to nickname wallets locally
The changes are persisted to localstorage, so they cannot be restored on a new computer, but for right now it's a nice organizational feature.
Diffstat (limited to 'test/unit/actions')
-rw-r--r-- | test/unit/actions/save_account_label_test.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/unit/actions/save_account_label_test.js b/test/unit/actions/save_account_label_test.js new file mode 100644 index 000000000..1df428b1d --- /dev/null +++ b/test/unit/actions/save_account_label_test.js @@ -0,0 +1,36 @@ +var jsdom = require('mocha-jsdom') +var assert = require('assert') +var freeze = require('deep-freeze-strict') +var path = require('path') + +var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js')) +var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js')) + +describe('SAVE_ACCOUNT_LABEL', function() { + + it('updates the state.metamask.identities[:i].name property of the state to the action.value.label', function() { + var initialState = { + metamask: { + identities: { + foo: { + name: 'bar' + } + }, + } + } + freeze(initialState) + + const action = { + type: actions.SAVE_ACCOUNT_LABEL, + value: { + account: 'foo', + label: 'baz' + }, + } + freeze(action) + + var resultingState = reducers(initialState, action) + assert.equal(resultingState.metamask.identities.foo.name, action.value.label) + }); +}); + |