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 | 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); | |
| }); | |
| }); | |