summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2023-08-17 14:13:22 -0700
committerMatthew Miller <matthew@millerti.me>2023-08-17 14:13:22 -0700
commitf7b2256ab0fc1ee0676073f8f59d0234cac0f840 (patch)
treed5627cab7abeef2d46b8f0ba1a6b24a503864e07 /packages/server/src
parent19c231202c43b83b4ceaeed99b24275b4f71d4e4 (diff)
Update verifyAttestationAndroidKey tests
Diffstat (limited to 'packages/server/src')
-rw-r--r--packages/server/src/registration/verifications/verifyAttestationAndroidKey.test.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/packages/server/src/registration/verifications/verifyAttestationAndroidKey.test.ts b/packages/server/src/registration/verifications/verifyAttestationAndroidKey.test.ts
index 67aa411..fee0252 100644
--- a/packages/server/src/registration/verifications/verifyAttestationAndroidKey.test.ts
+++ b/packages/server/src/registration/verifications/verifyAttestationAndroidKey.test.ts
@@ -1,6 +1,6 @@
-import { SettingsService } from "../../services/settingsService.ts";
-import { isoBase64URL } from "../../helpers/iso/index.ts";
+import { assertEquals } from "https://deno.land/std@0.198.0/assert/mod.ts";
+import { SettingsService } from "../../services/settingsService.ts";
import { verifyRegistrationResponse } from "../verifyRegistrationResponse.ts";
/**
@@ -12,9 +12,7 @@ SettingsService.setRootCertificates({
certificates: [],
});
-test("should verify Android KeyStore response", async () => {
- const expectedChallenge = "4ab7dfd1-a695-4777-985f-ad2993828e99";
- jest.spyOn(isoBase64URL, "fromString").mockReturnValueOnce(expectedChallenge);
+Deno.test("should verify Android KeyStore response", async () => {
const verification = await verifyRegistrationResponse({
response: {
id: "V51GE29tGbhby7sbg1cZ_qL8V8njqEsXpAnwQBobvgw",
@@ -29,11 +27,11 @@ test("should verify Android KeyStore response", async () => {
type: "public-key",
clientExtensionResults: {},
},
- expectedChallenge,
+ expectedChallenge: "4ab7dfd1-a695-4777-985f-ad2993828e99",
expectedOrigin: "https://dev.dontneeda.pw",
expectedRPID: "dev.dontneeda.pw",
requireUserVerification: false,
});
- expect(verification.verified).toEqual(true);
+ assertEquals(verification.verified, true);
});