test: add check-email regression guard for deckyvault.xyz login (Task 4)

This commit is contained in:
2026-05-28 00:13:10 +08:00
parent aa39fda696
commit 542b855555
+23
View File
@@ -39,3 +39,26 @@ describe("check-email response contract", () => {
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")
})
})