diff --git a/apps/desktop/src/app/accounts/settings.component.spec.ts b/apps/desktop/src/app/accounts/settings.component.spec.ts index 4219a9952c6..93dea25e3cc 100644 --- a/apps/desktop/src/app/accounts/settings.component.spec.ts +++ b/apps/desktop/src/app/accounts/settings.component.spec.ts @@ -149,6 +149,7 @@ describe("SettingsComponent", () => { component = fixture.componentInstance; fixture.detectChanges(); + desktopBiometricsService.hasPersistentKey.mockResolvedValue(false); vaultTimeoutSettingsService.getVaultTimeoutByUserId$.mockReturnValue( of(VaultTimeoutStringType.OnLocked), ); diff --git a/apps/desktop/src/key-management/biometrics/main-biometrics.service.spec.ts b/apps/desktop/src/key-management/biometrics/main-biometrics.service.spec.ts index bc57a7e55fb..22c94703f28 100644 --- a/apps/desktop/src/key-management/biometrics/main-biometrics.service.spec.ts +++ b/apps/desktop/src/key-management/biometrics/main-biometrics.service.spec.ts @@ -1,7 +1,5 @@ import { mock, MockProxy } from "jest-mock-extended"; -import { CryptoFunctionService } from "@bitwarden/common/key-management/crypto/abstractions/crypto-function.service"; -import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { EncryptionType } from "@bitwarden/common/platform/enums"; @@ -23,7 +21,16 @@ import { OsBiometricService } from "./os-biometrics.service"; jest.mock("@bitwarden/desktop-napi", () => { return { - biometrics: jest.fn(), + biometrics: { + authenticate: jest.fn(), + authenticate_available: jest.fn(), + enroll_persistent: jest.fn(), + provide_key: jest.fn(), + unlock: jest.fn(), + unlock_available: jest.fn(), + has_persistent: jest.fn(), + initBiometricSystem: jest.fn(), + }, passwords: jest.fn(), }; }); @@ -35,8 +42,6 @@ describe("MainBiometricsService", function () { const windowMain = mock(); const logService = mock(); const biometricStateService = mock(); - const cryptoFunctionService = mock(); - const encryptService = mock(); it("Should call the platformspecific methods", async () => { const sut = new MainBiometricsService( @@ -45,8 +50,6 @@ describe("MainBiometricsService", function () { logService, process.platform, biometricStateService, - encryptService, - cryptoFunctionService, ); const mockService = mock(); @@ -64,8 +67,6 @@ describe("MainBiometricsService", function () { logService, "win32", biometricStateService, - encryptService, - cryptoFunctionService, ); const internalService = (sut as any).osBiometricsService; @@ -80,8 +81,6 @@ describe("MainBiometricsService", function () { logService, "darwin", biometricStateService, - encryptService, - cryptoFunctionService, ); const internalService = (sut as any).osBiometricsService; expect(internalService).not.toBeNull(); @@ -95,8 +94,6 @@ describe("MainBiometricsService", function () { logService, "linux", biometricStateService, - encryptService, - cryptoFunctionService, ); const internalService = (sut as any).osBiometricsService; @@ -116,8 +113,6 @@ describe("MainBiometricsService", function () { logService, process.platform, biometricStateService, - encryptService, - cryptoFunctionService, ); innerService = mock(); @@ -215,8 +210,6 @@ describe("MainBiometricsService", function () { logService, process.platform, biometricStateService, - encryptService, - cryptoFunctionService, ); const osBiometricsService = mock(); (sut as any).osBiometricsService = osBiometricsService; @@ -235,8 +228,6 @@ describe("MainBiometricsService", function () { logService, process.platform, biometricStateService, - encryptService, - cryptoFunctionService, ); const osBiometricsService = mock(); (sut as any).osBiometricsService = osBiometricsService; @@ -258,8 +249,6 @@ describe("MainBiometricsService", function () { logService, process.platform, biometricStateService, - encryptService, - cryptoFunctionService, ); osBiometricsService = mock(); (sut as any).osBiometricsService = osBiometricsService; @@ -299,8 +288,6 @@ describe("MainBiometricsService", function () { logService, process.platform, biometricStateService, - encryptService, - cryptoFunctionService, ); osBiometricsService = mock(); (sut as any).osBiometricsService = osBiometricsService; @@ -323,8 +310,6 @@ describe("MainBiometricsService", function () { logService, process.platform, biometricStateService, - encryptService, - cryptoFunctionService, ); const osBiometricsService = mock(); (sut as any).osBiometricsService = osBiometricsService; @@ -347,8 +332,6 @@ describe("MainBiometricsService", function () { logService, process.platform, biometricStateService, - encryptService, - cryptoFunctionService, ); }); @@ -377,8 +360,6 @@ describe("MainBiometricsService", function () { logService, process.platform, biometricStateService, - encryptService, - cryptoFunctionService, ); const shouldAutoPrompt = await sut.getShouldAutopromptNow();