feat: unify Person and User creation form with conditional password
This commit is contained in:
@@ -108,13 +108,15 @@ describe("core schemas", () => {
|
||||
)
|
||||
|
||||
expect(
|
||||
signInSchema.safeParse({ email: "admin@test.com", password: "abc" }).success,
|
||||
signInSchema.safeParse({ email: "admin@test.com", password: "abc" })
|
||||
.success,
|
||||
).toBe(true)
|
||||
expect(signInSchema.safeParse({ email: "", password: "abc" }).success).toBe(
|
||||
false,
|
||||
)
|
||||
expect(
|
||||
signInSchema.safeParse({ email: "", password: "abc" }).success,
|
||||
).toBe(false)
|
||||
expect(
|
||||
signInSchema.safeParse({ email: "admin@test.com", password: "ab" }).success,
|
||||
signInSchema.safeParse({ email: "admin@test.com", password: "ab" })
|
||||
.success,
|
||||
).toBe(false)
|
||||
})
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { describe, expect, it } from "vitest"
|
||||
|
||||
import {
|
||||
buildUnifiedCreateSchema,
|
||||
unifiedFormRoleSchema,
|
||||
type UnifiedSchemaCopy,
|
||||
unifiedFormRoleSchema,
|
||||
} from "@/schemas/user.schema"
|
||||
|
||||
const enCopy: UnifiedSchemaCopy = {
|
||||
@@ -260,4 +260,4 @@ describe("buildUnifiedCreateSchema", () => {
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user