Skip to content

Commit

Permalink
Update exportAccount tests to verifyPassword
Browse files Browse the repository at this point in the history
  • Loading branch information
tmashuang committed Aug 21, 2020
1 parent 9bce868 commit 5a0a9c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/unit/ui/app/actions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1144,10 +1144,10 @@ describe('Actions', function () {
})

describe('#exportAccount', function () {
let submitPasswordSpy, exportAccountSpy
let verifyPasswordSpy, exportAccountSpy

afterEach(function () {
submitPasswordSpy.restore()
verifyPasswordSpy.restore()
exportAccountSpy.restore()
})

Expand All @@ -1159,11 +1159,11 @@ describe('Actions', function () {
{ type: 'SHOW_PRIVATE_KEY', value: '7ec73b91bb20f209a7ff2d32f542c3420b4fccf14abcc7840d2eff0ebcb18505' },
]

submitPasswordSpy = sinon.spy(background, 'submitPassword')
verifyPasswordSpy = sinon.spy(background, 'verifyPassword')
exportAccountSpy = sinon.spy(background, 'exportAccount')

await store.dispatch(actions.exportAccount(password, '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc'))
assert(submitPasswordSpy.calledOnce)
assert(verifyPasswordSpy.calledOnce)
assert(exportAccountSpy.calledOnce)
assert.deepEqual(store.getActions(), expectedActions)
})
Expand All @@ -1176,8 +1176,8 @@ describe('Actions', function () {
{ type: 'DISPLAY_WARNING', value: 'Incorrect Password.' },
]

submitPasswordSpy = sinon.stub(background, 'submitPassword')
submitPasswordSpy.callsFake((_, callback) => {
verifyPasswordSpy = sinon.stub(background, 'verifyPassword')
verifyPasswordSpy.callsFake((_, callback) => {
callback(new Error('error'))
})

Expand Down

0 comments on commit 5a0a9c3

Please sign in to comment.