Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 committed May 10, 2022
1 parent 8c52e14 commit 8151216
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,23 @@ describe('KeyringController', function () {
),
).rejects.toThrow('Seed phrase is invalid.');
});

it('accepts mnemonic passed as type array of numbers', async function () {
const allAccountsBefore = await keyringController.getAccounts();
expect(allAccountsBefore[0]).not.toBe(walletTwoAddresses[0]);
const mnemonicAsArrayOfNumbers = Array.from(
Buffer.from(walletTwoSeedWords).values(),
);

await keyringController.createNewVaultAndRestore(
password,
mnemonicAsArrayOfNumbers,
);

const allAccountsAfter = await keyringController.getAccounts();
expect(allAccountsAfter).toHaveLength(1);
expect(allAccountsAfter[0]).toBe(walletTwoAddresses[0]);
});
});

describe('addNewKeyring', function () {
Expand Down

0 comments on commit 8151216

Please sign in to comment.