mirror of
https://github.com/bitwarden/browser
synced 2026-02-10 13:40:06 +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:
@@ -6,16 +6,15 @@ import { UserId } from "@bitwarden/common/types/guid";
|
||||
import { biometrics } from "@bitwarden/desktop-napi";
|
||||
import { BiometricsStatus } from "@bitwarden/key-management";
|
||||
|
||||
|
||||
import { WindowMain } from "../../main/window.main";
|
||||
|
||||
import OsBiometricsServiceWindows from "./os-biometrics-windows.service";
|
||||
|
||||
|
||||
jest.mock("@bitwarden/desktop-napi", () => ({
|
||||
biometrics: {
|
||||
initBiometricSystem: jest.fn(() => "mockSystem"),
|
||||
provideKey: jest.fn(),
|
||||
enrollPersistent: jest.fn(),
|
||||
unenroll: jest.fn(),
|
||||
unlock: jest.fn(),
|
||||
authenticate: jest.fn(),
|
||||
@@ -50,6 +49,11 @@ describe("OsBiometricsServiceWindows", () => {
|
||||
service = new OsBiometricsServiceWindows(i18nService, windowMain);
|
||||
});
|
||||
|
||||
it("should enroll persistent biometric key", async () => {
|
||||
await service.enrollPersistent("user-id" as UserId, new SymmetricCryptoKey(mockKey));
|
||||
expect(biometrics.enrollPersistent).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should set biometric key", async () => {
|
||||
await service.setBiometricKey(userId, new SymmetricCryptoKey(mockKey));
|
||||
expect(biometrics.provideKey).toHaveBeenCalled();
|
||||
|
||||
Reference in New Issue
Block a user