1
0
mirror of https://github.com/bitwarden/jslib synced 2026-01-03 17:13:14 +00:00

Add test for making new KeyPair for old account

This commit is contained in:
Thomas Rittson
2021-12-15 12:49:36 +10:00
parent bfda066bd7
commit e2fd3bd5a9

View File

@@ -246,6 +246,21 @@ describe('Cipher Service', () => {
keyConnectorService.received(1).getAndSetKey(keyConnectorUrl);
});
it('logIn: makes new KeyPair for an old account', async () => {
logInSetup();
commonSetup();
const tokenResponse = newTokenResponse();
tokenResponse.privateKey = null;
tokenService.getTwoFactorToken(email).resolves(null);
apiService.postIdentityToken(Arg.any()).resolves(tokenResponse);
const result = await authService.logIn(email, masterPassword);
commonSuccessAssertions();
apiService.received(1).postAccountKeys(Arg.any());
});
// it('login: new SSO user with Key Connector posts key to the server', async () => {
// logInSetup();
// commonSetup();