Skip to content

Commit

Permalink
test: add test for deterministic encryption key
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Jan 23, 2025
1 parent 6e8e4d4 commit 3a79248
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/specs/onboarding/onboarding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,27 @@ test.describe('Onboarding an existing user', () => {
});
});
});

// Functionality is important for backwards compatibility with older wallet versions
test.describe('Encryption key values', () => {
test.beforeEach(async ({ extensionId, globalPage, onboardingPage }) => {
await globalPage.setupAndUseApiCalls(extensionId);
await onboardingPage.signInWithTestAccount(extensionId);
});

test('that the encryption key is generated correctly against a known working value', async ({
globalPage,
}) => {
const encryptionKey = await globalPage.page.evaluate(async () => {
const { encryptionKey } = await chrome.storage.session.get('encryptionKey');
return encryptionKey;
});

test
.expect(encryptionKey)
.toEqual(
'd904f412b8d116540017c302f3f7033813c95902af5a067c7befcc34fa5e5290709f157f80548603a1e4f8edc2c0d5d7'
);
});
});
});

0 comments on commit 3a79248

Please sign in to comment.