Fix unit tests

This commit is contained in:
Bernd Schoolmann 2024-06-11 17:35:31 +02:00
parent c01e1b7c04
commit bf632dc515
No known key found for this signature in database
4 changed files with 9 additions and 1 deletions

View File

@ -211,6 +211,7 @@ describe("SsoLoginStrategy", () => {
HasAdminApproval: true, HasAdminApproval: true,
HasLoginApprovingDevice: true, HasLoginApprovingDevice: true,
HasManageResetPasswordPermission: false, HasManageResetPasswordPermission: false,
IsTdeOffboarding: false,
EncryptedPrivateKey: mockEncDevicePrivateKey, EncryptedPrivateKey: mockEncDevicePrivateKey,
EncryptedUserKey: mockEncUserKey, EncryptedUserKey: mockEncUserKey,
}, },
@ -322,6 +323,7 @@ describe("SsoLoginStrategy", () => {
HasAdminApproval: true, HasAdminApproval: true,
HasLoginApprovingDevice: false, HasLoginApprovingDevice: false,
HasManageResetPasswordPermission: false, HasManageResetPasswordPermission: false,
IsTdeOffboarding: false,
EncryptedPrivateKey: mockEncDevicePrivateKey, EncryptedPrivateKey: mockEncDevicePrivateKey,
EncryptedUserKey: mockEncUserKey, EncryptedUserKey: mockEncUserKey,
}, },

View File

@ -29,10 +29,12 @@ export class FakeTrustedDeviceUserDecryptionOption extends TrustedDeviceUserDecr
hasAdminApproval: boolean, hasAdminApproval: boolean,
hasLoginApprovingDevice: boolean, hasLoginApprovingDevice: boolean,
hasManageResetPasswordPermission: boolean, hasManageResetPasswordPermission: boolean,
isTdOffboarding: boolean,
) { ) {
super(); super();
this.hasAdminApproval = hasAdminApproval; this.hasAdminApproval = hasAdminApproval;
this.hasLoginApprovingDevice = hasLoginApprovingDevice; this.hasLoginApprovingDevice = hasLoginApprovingDevice;
this.hasManageResetPasswordPermission = hasManageResetPasswordPermission; this.hasManageResetPasswordPermission = hasManageResetPasswordPermission;
this.isTdeOffboarding = isTdOffboarding;
} }
} }

View File

@ -8,6 +8,8 @@ import {
} from "@bitwarden/common/spec"; } from "@bitwarden/common/spec";
import { UserId } from "@bitwarden/common/types/guid"; import { UserId } from "@bitwarden/common/types/guid";
import { UserDecryptionOptions } from "../../models/domain/user-decryption-options";
import { import {
USER_DECRYPTION_OPTIONS, USER_DECRYPTION_OPTIONS,
UserDecryptionOptionsService, UserDecryptionOptionsService,
@ -27,12 +29,13 @@ describe("UserDecryptionOptionsService", () => {
sut = new UserDecryptionOptionsService(fakeStateProvider); sut = new UserDecryptionOptionsService(fakeStateProvider);
}); });
const userDecryptionOptions = { const userDecryptionOptions: UserDecryptionOptions = {
hasMasterPassword: true, hasMasterPassword: true,
trustedDeviceOption: { trustedDeviceOption: {
hasAdminApproval: false, hasAdminApproval: false,
hasLoginApprovingDevice: false, hasLoginApprovingDevice: false,
hasManageResetPasswordPermission: true, hasManageResetPasswordPermission: true,
isTdeOffboarding: false,
}, },
keyConnectorOption: { keyConnectorOption: {
keyConnectorUrl: "https://keyconnector.bitwarden.com", keyConnectorUrl: "https://keyconnector.bitwarden.com",

View File

@ -5,6 +5,7 @@ export interface ITrustedDeviceUserDecryptionOptionServerResponse {
HasAdminApproval: boolean; HasAdminApproval: boolean;
HasLoginApprovingDevice: boolean; HasLoginApprovingDevice: boolean;
HasManageResetPasswordPermission: boolean; HasManageResetPasswordPermission: boolean;
IsTdeOffboarding: boolean;
EncryptedPrivateKey?: string; EncryptedPrivateKey?: string;
EncryptedUserKey?: string; EncryptedUserKey?: string;
} }