mirror of
https://github.com/bitwarden/browser
synced 2026-02-12 06:23:38 +00:00
PM-14927 changed retrieveCriticalApps to private method
This commit is contained in:
@@ -116,12 +116,10 @@ describe("CriticalAppsApiService", () => {
|
||||
|
||||
encryptService.decryptToUtf8.mockResolvedValue("https://example.com");
|
||||
apiService.send.mockResolvedValue(response);
|
||||
const spy = jest.spyOn(service, "retrieveCriticalApps");
|
||||
|
||||
service.setOrganizationId(orgId as OrganizationId);
|
||||
flush();
|
||||
|
||||
expect(spy).toHaveBeenCalled();
|
||||
expect(keyService.getOrgKey).toHaveBeenCalledWith(orgId.toString());
|
||||
expect(encryptService.decryptToUtf8).toHaveBeenCalledTimes(2);
|
||||
expect(apiService.send).toHaveBeenCalledWith(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable, OnDestroy } from "@angular/core";
|
||||
import { BehaviorSubject, firstValueFrom, map, Observable, Subject, takeUntil } from "rxjs";
|
||||
import { BehaviorSubject, firstValueFrom, map, Observable, of, Subject, takeUntil } from "rxjs";
|
||||
import { Opaque } from "type-fest";
|
||||
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
@@ -90,11 +90,9 @@ export class CriticalAppsApiService implements OnDestroy {
|
||||
this.orgId.next(orgId);
|
||||
}
|
||||
|
||||
async retrieveCriticalApps(
|
||||
orgId: OrganizationId | null,
|
||||
): Promise<PasswordHealthReportApplicationsResponse[]> {
|
||||
private async retrieveCriticalApps(orgId: OrganizationId | null) {
|
||||
if (orgId === null) {
|
||||
return [];
|
||||
return of([]);
|
||||
}
|
||||
|
||||
const response = await this.apiService.send(
|
||||
@@ -126,7 +124,6 @@ export class CriticalAppsApiService implements OnDestroy {
|
||||
);
|
||||
|
||||
this.criticalAppsList.next(updatedList);
|
||||
return updatedList;
|
||||
}
|
||||
|
||||
private async filterNewEntries(orgId: OrganizationId, selectedUrls: string[]): Promise<string[]> {
|
||||
|
||||
Reference in New Issue
Block a user