1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 05:00:10 +00:00

PM-20577 fixed failing unit tests

This commit is contained in:
voommen-livefront
2025-05-09 13:26:56 -05:00
parent 9319dbcc90
commit 585c7b0474
2 changed files with 13 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ export class RiskInsightsApiService {
return from(dbResponse as Promise<SaveRiskInsightsReportResponse>);
}
getRiskInsightsReport(orgId: OrganizationId): Observable<GetRiskInsightsReportResponse> {
getRiskInsightsReport(orgId: OrganizationId): Observable<GetRiskInsightsReportResponse | null> {
const dbResponse = this.apiService
.send("GET", `/reports/risk-insights-report/${orgId.toString()}`, null, true, true)
.catch((error: any): any => {

View File

@@ -3,10 +3,14 @@ import { firstValueFrom } from "rxjs";
import { ZXCVBNResult } from "zxcvbn";
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service";
import { KeyGenerationService } from "@bitwarden/common/platform/abstractions/key-generation.service";
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { KeyService } from "@bitwarden/key-management";
import { mockCiphers } from "./ciphers.mock";
import { CriticalAppsService } from "./critical-apps.service";
import { MemberCipherDetailsApiService } from "./member-cipher-details-api.service";
import { mockMemberCipherDetails } from "./member-cipher-details-api.service.spec";
import { RiskInsightsReportService } from "./risk-insights-report.service";
@@ -17,6 +21,10 @@ describe("RiskInsightsReportService", () => {
const auditService = mock<AuditService>();
const cipherService = mock<CipherService>();
const memberCipherDetailsService = mock<MemberCipherDetailsApiService>();
const keyService = mock<KeyService>();
const encryptService = mock<EncryptService>();
const criticalAppsService = mock<CriticalAppsService>();
const keyGenerationService = mock<KeyGenerationService>();
beforeEach(() => {
pwdStrengthService.getPasswordStrength.mockImplementation((password: string) => {
@@ -37,6 +45,10 @@ describe("RiskInsightsReportService", () => {
auditService,
cipherService,
memberCipherDetailsService,
keyService,
encryptService,
criticalAppsService,
keyGenerationService,
);
});