From ead70a390d2e603dee43d64c04316283ca8b1787 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Thu, 2 Dec 2021 10:06:44 +0000 Subject: [PATCH] Update Captcha Auth Tests --- server/src/server/router/api/v1/auth/auth.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/server/router/api/v1/auth/auth.test.ts b/server/src/server/router/api/v1/auth/auth.test.ts index 631064eac..f10052355 100644 --- a/server/src/server/router/api/v1/auth/auth.test.ts +++ b/server/src/server/router/api/v1/auth/auth.test.ts @@ -2,7 +2,7 @@ import { AddNewInvite, ReinstateInvite, ValidateCaptcha } from "./auth"; import t from "tap"; import db from "external/mongo/db"; import ResetDBState from "test-utils/resets"; -import { MockBasicFetch } from "test-utils/mock-fetch"; +import { MockBasicFetch, MockJSONFetch } from "test-utils/mock-fetch"; t.test("#ReinstateInvite", (t) => { t.beforeEach(ResetDBState); @@ -58,15 +58,15 @@ t.test("#AddNewInvite", (t) => { t.test("#ValidateCaptcha", async (t) => { t.equal( - await ValidateCaptcha("200", "bar", MockBasicFetch({ status: 200 })), + await ValidateCaptcha("200", "bar", MockJSONFetch({ success: true })), true, - "Validates captcha when status return is 200" + "Validates captcha when sucess return is true" ); t.equal( - await ValidateCaptcha("400", "bar", MockBasicFetch({ status: 400 })), + await ValidateCaptcha("400", "bar", MockJSONFetch({ success: false })), false, - "Invalidates captcha when status return is not 200" + "Invalidates captcha when success return is not true" ); t.end();