refactor: complete i18n rename recipients to people, finalize tests

This commit is contained in:
2026-06-16 12:25:57 +02:00
parent ecc3cf1b55
commit 29c7c19cd8
13 changed files with 263 additions and 774 deletions
+12 -15
View File
@@ -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,