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

Merge pull request #217 from MetaMask/FixWarning

incorrect password after signing in
This commit is contained in:
Dan Finlay 2016-05-25 16:01:56 -07:00
commit 82719632dd
3 changed files with 53 additions and 0 deletions

View File

@ -3,6 +3,7 @@
## Current Master
- Added copy address button to account list.
- Fixed bug where error warning was sometimes not cleared on view transition.
## 2.0.0 2016-05-23

View File

@ -0,0 +1,51 @@
var jsdom = require('mocha-jsdom')
var assert = require('assert')
var freeze = require('deep-freeze-strict')
var path = require('path')
var sinon = require('sinon')
var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
describe('#unlockMetamask(selectedAccount)', function() {
beforeEach(function() {
// sinon allows stubbing methods that are easily verified
this.sinon = sinon.sandbox.create()
})
afterEach(function() {
// sinon requires cleanup otherwise it will overwrite context
this.sinon.restore()
})
describe('after an error', function() {
it('clears warning', function() {
const warning = 'this is the wrong warning'
const account = 'foo_account'
const initialState = {
appState: {
warning: warning,
}
}
const resultState = reducers(initialState, actions.unlockMetamask(account))
assert.equal(resultState.appState.warning, null, 'warning nullified')
})
})
describe('going home after an error', function() {
it('clears warning', function() {
const warning = 'this is the wrong warning'
const account = 'foo_account'
const initialState = {
appState: {
warning: warning,
}
}
const resultState = reducers(initialState, actions.goHome())
assert.equal(resultState.appState.warning, null, 'warning nullified')
})
})
})

View File

@ -152,6 +152,7 @@ function reduceApp(state, action) {
privateKey: '',
},
transForward: false,
warning: null,
})
case actions.SHOW_ACCOUNT_DETAIL: