mirror of
https://github.com/bitwarden/jslib
synced 2025-12-11 13:53:22 +00:00
Update tests for new stateService interface
This commit is contained in:
@@ -16,7 +16,7 @@ import { AuthService } from "jslib-common/services/auth.service";
|
|||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
|
||||||
import { AccountProfile, AccountTokens } from "jslib-common/models/domain/account";
|
import { Account, AccountProfile, AccountTokens } from "jslib-common/models/domain/account";
|
||||||
import { AuthResult } from "jslib-common/models/domain/authResult";
|
import { AuthResult } from "jslib-common/models/domain/authResult";
|
||||||
import { EncString } from "jslib-common/models/domain/encString";
|
import { EncString } from "jslib-common/models/domain/encString";
|
||||||
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
||||||
@@ -130,25 +130,27 @@ describe("Cipher Service", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function commonSuccessAssertions() {
|
function commonSuccessAssertions() {
|
||||||
stateService.received(1).addAccount({
|
stateService.received(1).addAccount(
|
||||||
profile: {
|
new Account({
|
||||||
...new AccountProfile(),
|
profile: {
|
||||||
...{
|
...new AccountProfile(),
|
||||||
userId: userId,
|
...{
|
||||||
email: email,
|
userId: userId,
|
||||||
hasPremiumPersonally: false,
|
email: email,
|
||||||
kdfIterations: kdfIterations,
|
hasPremiumPersonally: false,
|
||||||
kdfType: kdf,
|
kdfIterations: kdfIterations,
|
||||||
|
kdfType: kdf,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
tokens: {
|
||||||
tokens: {
|
...new AccountTokens(),
|
||||||
...new AccountTokens(),
|
...{
|
||||||
...{
|
accessToken: accessToken,
|
||||||
accessToken: accessToken,
|
refreshToken: refreshToken,
|
||||||
refreshToken: refreshToken,
|
},
|
||||||
},
|
},
|
||||||
},
|
})
|
||||||
});
|
);
|
||||||
stateService.received(1).setBiometricLocked(false);
|
stateService.received(1).setBiometricLocked(false);
|
||||||
messagingService.received(1).send("loggedIn");
|
messagingService.received(1).send("loggedIn");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user