From 542b8555554d02c4ddc2773b4e0875d73dbb398f Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Thu, 28 May 2026 00:13:10 +0800 Subject: [PATCH] test: add check-email regression guard for deckyvault.xyz login (Task 4) --- lib/api/__tests__/check-email.test.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/api/__tests__/check-email.test.ts b/lib/api/__tests__/check-email.test.ts index 70f5f68..4fea789 100644 --- a/lib/api/__tests__/check-email.test.ts +++ b/lib/api/__tests__/check-email.test.ts @@ -38,4 +38,27 @@ describe("check-email response contract", () => { expect(errorShape).toHaveProperty("error") expect(typeof errorShape.error).toBe("string") }) +}) + +describe("check-email does NOT block deckyvault.xyz for login", () => { + it("accepts a @deckyvault.xyz email through loginEmailSchema", () => { + const result = loginEmailSchema.safeParse({ + email: "admin@deckyvault.xyz", + }) + expect(result.success).toBe(true) + }) + + it("accepts a @DECKYVAULT.XYZ email (uppercase) through loginEmailSchema", () => { + const result = loginEmailSchema.safeParse({ + email: "admin@DECKYVAULT.XYZ", + }) + expect(result.success).toBe(true) + }) + + it("the response contract still matches { exists: boolean }", () => { + const successShape = { exists: true } + const failureShape = { exists: false } + expect(typeof successShape.exists).toBe("boolean") + expect(typeof failureShape.exists).toBe("boolean") + }) }) \ No newline at end of file