diff options
author | Csaba Solya <csaba.solya@gmail.com> | 2018-03-04 05:08:10 +0800 |
---|---|---|
committer | Csaba Solya <csaba.solya@gmail.com> | 2018-03-04 05:08:10 +0800 |
commit | 2b86d65d0c3266e8ddfe814abe1d1755fbf23fda (patch) | |
tree | dee77324280c5787c8d2702d7db1d743743c55b9 /test/unit/seed-phrase-verifier-test.js | |
parent | 3e05b693dbf55ea7ecb791e8f31b7599a6b89ffd (diff) | |
download | tangerine-wallet-browser-2b86d65d0c3266e8ddfe814abe1d1755fbf23fda.tar tangerine-wallet-browser-2b86d65d0c3266e8ddfe814abe1d1755fbf23fda.tar.gz tangerine-wallet-browser-2b86d65d0c3266e8ddfe814abe1d1755fbf23fda.tar.bz2 tangerine-wallet-browser-2b86d65d0c3266e8ddfe814abe1d1755fbf23fda.tar.lz tangerine-wallet-browser-2b86d65d0c3266e8ddfe814abe1d1755fbf23fda.tar.xz tangerine-wallet-browser-2b86d65d0c3266e8ddfe814abe1d1755fbf23fda.tar.zst tangerine-wallet-browser-2b86d65d0c3266e8ddfe814abe1d1755fbf23fda.zip |
verify seedwords on log in
Diffstat (limited to 'test/unit/seed-phrase-verifier-test.js')
-rw-r--r-- | test/unit/seed-phrase-verifier-test.js | 48 |
1 files changed, 8 insertions, 40 deletions
diff --git a/test/unit/seed-phrase-verifier-test.js b/test/unit/seed-phrase-verifier-test.js index 3e9acfa82..654fb5994 100644 --- a/test/unit/seed-phrase-verifier-test.js +++ b/test/unit/seed-phrase-verifier-test.js @@ -9,16 +9,20 @@ describe('SeedPhraseVerifier', function () { describe('verifyAccounts', function () { - var password = 'passw0rd1' + let password = 'passw0rd1' let hdKeyTree = 'HD Key Tree' - it('should be able to verify created account with seed words', async function () { - - let keyringController = new KeyringController({ + let keyringController + beforeEach(function () { + keyringController = new KeyringController({ initState: clone(firstTimeState), encryptor: mockEncryptor, }) + assert(keyringController) + }) + + it('should be able to verify created account with seed words', async function () { let vault = await keyringController.createNewVaultAndKeychain(password) let primaryKeyring = keyringController.getKeyringsByType(hdKeyTree)[0] @@ -35,12 +39,6 @@ describe('SeedPhraseVerifier', function () { it('should be able to verify created account (upper case) with seed words', async function () { - let keyringController = new KeyringController({ - initState: clone(firstTimeState), - encryptor: mockEncryptor, - }) - assert(keyringController) - let vault = await keyringController.createNewVaultAndKeychain(password) let primaryKeyring = keyringController.getKeyringsByType(hdKeyTree)[0] @@ -57,12 +55,6 @@ describe('SeedPhraseVerifier', function () { it('should be able to verify created account (lower case) with seed words', async function () { - let keyringController = new KeyringController({ - initState: clone(firstTimeState), - encryptor: mockEncryptor, - }) - assert(keyringController) - let vault = await keyringController.createNewVaultAndKeychain(password) let primaryKeyring = keyringController.getKeyringsByType(hdKeyTree)[0] @@ -79,12 +71,6 @@ describe('SeedPhraseVerifier', function () { it('should return error with good but different seed words', async function () { - let keyringController = new KeyringController({ - initState: clone(firstTimeState), - encryptor: mockEncryptor, - }) - assert(keyringController) - let vault = await keyringController.createNewVaultAndKeychain(password) let primaryKeyring = keyringController.getKeyringsByType(hdKeyTree)[0] @@ -104,12 +90,6 @@ describe('SeedPhraseVerifier', function () { it('should return error with undefined existing accounts', async function () { - let keyringController = new KeyringController({ - initState: clone(firstTimeState), - encryptor: mockEncryptor, - }) - assert(keyringController) - let vault = await keyringController.createNewVaultAndKeychain(password) let primaryKeyring = keyringController.getKeyringsByType(hdKeyTree)[0] @@ -129,12 +109,6 @@ describe('SeedPhraseVerifier', function () { it('should return error with empty accounts array', async function () { - let keyringController = new KeyringController({ - initState: clone(firstTimeState), - encryptor: mockEncryptor, - }) - assert(keyringController) - let vault = await keyringController.createNewVaultAndKeychain(password) let primaryKeyring = keyringController.getKeyringsByType(hdKeyTree)[0] @@ -154,12 +128,6 @@ describe('SeedPhraseVerifier', function () { it('should be able to verify more than one created account with seed words', async function () { - let keyringController = new KeyringController({ - initState: clone(firstTimeState), - encryptor: mockEncryptor, - }) - assert(keyringController) - let vault = await keyringController.createNewVaultAndKeychain(password) let primaryKeyring = keyringController.getKeyringsByType(hdKeyTree)[0] |