feat: enhance sign-up process with email verification flow and error handling. Introduce new toast messages for verification success and continuation, and implement duplicate email error detection. Update sign-up form to streamline user experience and improve feedback during the verification process.
f133948 Download apps/web/src/lib/__tests__/signup-errors.test.ts from Atmint/cpns: direct link, hf CLI and curl.
- Browser
- Download file 834 Bytes
-
https://huggingface.co/spaces/Atmint/cpns/resolve/main/apps/web/src/lib/__tests__/signup-errors.test.ts
- Command line
-
hf download hf://spaces/Atmint/cpns/apps/web/src/lib/__tests__/signup-errors.test.ts
-
curl -L -o signup-errors.test.ts https://huggingface.co/spaces/Atmint/cpns/resolve/main/apps/web/src/lib/__tests__/signup-errors.test.ts
834 Bytes
| import { describe, expect, it } from "bun:test"; | |
| import { isSignUpDuplicateError } from "../signup-errors"; | |
| describe("isSignUpDuplicateError", () => { | |
| it("detects already-exists style messages", () => { | |
| expect(isSignUpDuplicateError({ error: { message: "User already exists" } })).toBe(true); | |
| expect(isSignUpDuplicateError({ error: { message: "Email already registered" } })).toBe(true); | |
| }); | |
| it("detects conflict status codes", () => { | |
| expect(isSignUpDuplicateError({ error: { status: 409 } })).toBe(true); | |
| expect(isSignUpDuplicateError({ error: { status: 422 } })).toBe(true); | |
| }); | |
| it("does not flag unrelated errors", () => { | |
| expect(isSignUpDuplicateError({ error: { message: "Invalid password" } })).toBe(false); | |
| expect(isSignUpDuplicateError({ error: { status: 500 } })).toBe(false); | |
| }); | |
| }); | |