1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-19 17:53:48 +00:00

Move api specific stateService calls to entry method

This commit is contained in:
Thomas Rittson
2021-12-20 11:41:46 +10:00
parent 28e98905a0
commit 358ba67e82
2 changed files with 20 additions and 48 deletions

View File

@@ -136,8 +136,6 @@ describe("Cipher Service", () => {
...{
userId: userId,
email: email,
apiKeyClientId: null,
apiKeyClientSecret: null,
hasPremiumPersonally: false,
kdfIterations: kdfIterations,
kdfType: kdf,
@@ -539,30 +537,11 @@ describe("Cipher Service", () => {
})
);
// Sets local environment:
stateService.received(1).addAccount({
profile: {
...new AccountProfile(),
...{
userId: userId,
email: email,
apiKeyClientId: apiClientId,
apiKeyClientSecret: apiClientSecret,
hasPremiumPersonally: false,
kdfIterations: kdfIterations,
kdfType: kdf,
},
},
tokens: {
...new AccountTokens(),
...{
accessToken: accessToken,
refreshToken: refreshToken,
},
},
});
stateService.received(1).setBiometricLocked(false);
messagingService.received(1).send("loggedIn");
stateService.received(1).setApiKeyClientId(apiClientId);
stateService.received(1).setApiKeyClientSecret(apiClientSecret);
commonSuccessAssertions();
cryptoService.received(1).setEncKey(encKey);
cryptoService.received(1).setEncPrivateKey(privateKey);