1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-05 11:13:44 +00:00

Merge branch 'km/poc-windows-hello-2' of https://github.com/bitwarden/clients into km/poc-windows-hello-2

This commit is contained in:
Bernd Schoolmann
2025-08-29 14:24:43 +02:00
2 changed files with 11 additions and 29 deletions

View File

@@ -149,6 +149,7 @@ describe("SettingsComponent", () => {
component = fixture.componentInstance;
fixture.detectChanges();
desktopBiometricsService.hasPersistentKey.mockResolvedValue(false);
vaultTimeoutSettingsService.getVaultTimeoutByUserId$.mockReturnValue(
of(VaultTimeoutStringType.OnLocked),
);

View File

@@ -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<WindowMain>();
const logService = mock<LogService>();
const biometricStateService = mock<BiometricStateService>();
const cryptoFunctionService = mock<CryptoFunctionService>();
const encryptService = mock<EncryptService>();
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<OsBiometricService>();
@@ -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<OsBiometricService>();
(sut as any).osBiometricsService = osBiometricsService;
@@ -235,8 +228,6 @@ describe("MainBiometricsService", function () {
logService,
process.platform,
biometricStateService,
encryptService,
cryptoFunctionService,
);
const osBiometricsService = mock<OsBiometricService>();
(sut as any).osBiometricsService = osBiometricsService;
@@ -258,8 +249,6 @@ describe("MainBiometricsService", function () {
logService,
process.platform,
biometricStateService,
encryptService,
cryptoFunctionService,
);
osBiometricsService = mock<OsBiometricService>();
(sut as any).osBiometricsService = osBiometricsService;
@@ -299,8 +288,6 @@ describe("MainBiometricsService", function () {
logService,
process.platform,
biometricStateService,
encryptService,
cryptoFunctionService,
);
osBiometricsService = mock<OsBiometricService>();
(sut as any).osBiometricsService = osBiometricsService;
@@ -323,8 +310,6 @@ describe("MainBiometricsService", function () {
logService,
process.platform,
biometricStateService,
encryptService,
cryptoFunctionService,
);
const osBiometricsService = mock<OsBiometricService>();
(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();