refactor: complete i18n rename recipients to people, finalize tests
This commit is contained in:
@@ -5,7 +5,7 @@ import { signInSchema } from "@/schemas/auth.schema"
|
||||
import { createCategorySchema } from "@/schemas/category.schema"
|
||||
import { createItemSchema, updateItemSchema } from "@/schemas/item.schema"
|
||||
import { createMovementSchema } from "@/schemas/movement.schema"
|
||||
import { createRecipientSchema } from "@/schemas/recipient.schema"
|
||||
import { createPersonSchema } from "@/schemas/person.schema"
|
||||
import { createUserSchema, updateUserSchema } from "@/schemas/user.schema"
|
||||
|
||||
describe("core schemas", () => {
|
||||
@@ -120,32 +120,29 @@ describe("core schemas", () => {
|
||||
).toBe(false)
|
||||
})
|
||||
|
||||
it("validates recipient email only when present", () => {
|
||||
it("validates person email only when present", () => {
|
||||
expect(
|
||||
createRecipientSchema.safeParse({
|
||||
username: "recipient",
|
||||
firstName: "Rec",
|
||||
lastName: "Ipient",
|
||||
createPersonSchema.safeParse({
|
||||
firstName: "Per",
|
||||
lastName: "Son",
|
||||
department: "IT",
|
||||
email: "recipient@example.test",
|
||||
email: "person@example.test",
|
||||
}).success,
|
||||
).toBe(true)
|
||||
|
||||
expect(
|
||||
createRecipientSchema.safeParse({
|
||||
username: "recipient",
|
||||
firstName: "Rec",
|
||||
lastName: "Ipient",
|
||||
createPersonSchema.safeParse({
|
||||
firstName: "Per",
|
||||
lastName: "Son",
|
||||
department: "IT",
|
||||
email: "not-an-email",
|
||||
}).success,
|
||||
).toBe(false)
|
||||
|
||||
expect(
|
||||
createRecipientSchema.safeParse({
|
||||
username: "recipient",
|
||||
firstName: "Rec",
|
||||
lastName: "Ipient",
|
||||
createPersonSchema.safeParse({
|
||||
firstName: "Per",
|
||||
lastName: "Son",
|
||||
department: "IT",
|
||||
email: "",
|
||||
}).success,
|
||||
|
||||
Reference in New Issue
Block a user