diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/actions/restore_vault_test.js | 8 | ||||
-rw-r--r-- | test/unit/actions/set_selected_account_test.js | 21 |
2 files changed, 28 insertions, 1 deletions
diff --git a/test/unit/actions/restore_vault_test.js b/test/unit/actions/restore_vault_test.js index 5675028b1..609f5429e 100644 --- a/test/unit/actions/restore_vault_test.js +++ b/test/unit/actions/restore_vault_test.js @@ -21,7 +21,13 @@ describe('#recoverFromSeed(password, seed)', function() { // stub out account manager actions._setAccountManager({ - recoverFromSeed(pw, seed, cb) { cb(null, [{}, {}]) }, + recoverFromSeed(pw, seed, cb) { + cb(null, { + identities: { + foo: 'bar' + } + }) + }, }) it('sets metamask.isUnlocked to true', function() { diff --git a/test/unit/actions/set_selected_account_test.js b/test/unit/actions/set_selected_account_test.js index 0487bc5f0..69eb11e47 100644 --- a/test/unit/actions/set_selected_account_test.js +++ b/test/unit/actions/set_selected_account_test.js @@ -26,3 +26,24 @@ describe('SET_SELECTED_ACCOUNT', function() { assert.equal(resultingState.appState.activeAddress, action.value) }); }); + +describe('SHOW_ACCOUNT_DETAIL', function() { + it('updates metamask state', function() { + var initialState = { + metamask: { + selectedAccount: 'foo' + } + } + freeze(initialState) + + const action = { + type: actions.SHOW_ACCOUNT_DETAIL, + value: 'bar', + } + freeze(action) + + var resultingState = reducers(initialState, action) + assert.equal(resultingState.metamask.selectedAccount, action.value) + assert.equal(resultingState.metamask.selectedAddress, action.value) + }) +}) |