diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-09-13 02:07:25 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-09-13 02:13:26 +0800 |
commit | 363c2a0939aba5fa73e08ff8e6d65581031242d5 (patch) | |
tree | 1cac1090cd3813d57752d4cd2b77e3d26f6f6aac /test/unit | |
parent | fcc9ca812e557fd5ecc547f5eb597069788d6c00 (diff) | |
download | tangerine-wallet-browser-363c2a0939aba5fa73e08ff8e6d65581031242d5.tar tangerine-wallet-browser-363c2a0939aba5fa73e08ff8e6d65581031242d5.tar.gz tangerine-wallet-browser-363c2a0939aba5fa73e08ff8e6d65581031242d5.tar.bz2 tangerine-wallet-browser-363c2a0939aba5fa73e08ff8e6d65581031242d5.tar.lz tangerine-wallet-browser-363c2a0939aba5fa73e08ff8e6d65581031242d5.tar.xz tangerine-wallet-browser-363c2a0939aba5fa73e08ff8e6d65581031242d5.tar.zst tangerine-wallet-browser-363c2a0939aba5fa73e08ff8e6d65581031242d5.zip |
Fix account unlocking
SubmitPassword was not creating a new id-management
This is because I broke up the old "createIdmgmt" method to not perform as much conditional logic.
Now the pieces are reusable and do what they should do.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/idStore-test.js | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/test/unit/idStore-test.js b/test/unit/idStore-test.js index 1ed1bf9a7..ac416e5cd 100644 --- a/test/unit/idStore-test.js +++ b/test/unit/idStore-test.js @@ -109,6 +109,7 @@ describe('IdentityStore', function() { }) it('should enforce seed compliance with TestRPC', function (done) { + this.timeout(5000) const tests = assertions.map((assertion) => { return function (cb) { accounts = [] @@ -118,7 +119,17 @@ describe('IdentityStore', function() { var received = accounts[0].toLowerCase() var expected = assertion.account.toLowerCase() assert.equal(received, expected) - cb() + + idStore.tryPassword(password, function (err) { + + assert.ok(idStore.isUnlocked(), 'should unlock the id store') + + idStore.submitPassword(password, function(err, account) { + assert.ifError(err) + assert.equal(account, expected) + cb() + }) + }) }) } }) @@ -128,23 +139,5 @@ describe('IdentityStore', function() { done() }) }) - - it('should allow restoring and unlocking again', function (done) { - const assertion = assertions[0] - idStore.recoverFromSeed(password, assertion.seed, (err) => { - assert.ifError(err) - - var received = accounts[0].toLowerCase() - var expected = assertion.account.toLowerCase() - assert.equal(received, expected) - - - idStore.submitPassword(password, function(err, account) { - assert.ifError(err) - assert.equal(account, expected) - done() - }) - }) - }) }) }) |