mirror of
https://github.com/bitwarden/browser
synced 2026-02-10 05:30:01 +00:00
Add test
This commit is contained in:
@@ -14,6 +14,7 @@ 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(),
|
||||
@@ -48,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