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
+46 -57
View File
@@ -52,7 +52,6 @@ describe("i18n dictionaries", () => {
items: "Items",
categories: "Categories",
assets: "Assets",
recipients: "Recipients",
people: "People",
movements: "Movements",
assignments: "Assignments",
@@ -67,7 +66,6 @@ describe("i18n dictionaries", () => {
category: "Category",
item: "Item",
asset: "Asset",
recipient: "Recipient",
person: "Person",
assignment: "Assignment",
},
@@ -89,7 +87,6 @@ describe("i18n dictionaries", () => {
items: "Artículos",
categories: "Categorías",
assets: "Activos",
recipients: "Destinatarios",
people: "Personas",
movements: "Movimientos",
assignments: "Asignaciones",
@@ -104,7 +101,6 @@ describe("i18n dictionaries", () => {
category: "Categoría",
item: "Artículo",
asset: "Activo",
recipient: "Destinatario",
person: "Persona",
assignment: "Asignación",
},
@@ -694,14 +690,13 @@ describe("i18n dictionaries", () => {
})
})
it("provides localized recipient UI copy for English and Spanish", () => {
expect(getDictionary("en").inventory.recipients).toEqual({
it("provides localized people UI copy for English and Spanish", () => {
expect(getDictionary("en").inventory.people).toEqual({
list: {
title: "Recipients",
addLabel: "Add Recipient",
empty: "No recipients found.",
title: "People",
addLabel: "Add Person",
empty: "No people found.",
columns: {
username: "Username",
name: "Name",
email: "Email",
phone: "Phone",
@@ -709,29 +704,26 @@ describe("i18n dictionaries", () => {
actions: "Actions",
},
actions: {
view: "View recipient",
edit: "Edit recipient",
view: "View person",
edit: "Edit person",
},
},
detail: {
notFound: "Recipient not found",
notFound: "Person not found",
labels: {
username: "Username",
email: "Email",
phone: "Phone",
department: "Department",
},
},
new: {
title: "Add Recipient",
title: "Add Person",
},
edit: {
title: "Edit Recipient",
notFound: "Recipient not found",
title: "Edit Person",
notFound: "Person not found",
},
form: {
usernameLabel: "Username",
usernamePlaceholder: "Username",
firstNameLabel: "First Name",
firstNamePlaceholder: "First name",
lastNameLabel: "Last Name",
@@ -742,8 +734,8 @@ describe("i18n dictionaries", () => {
emailPlaceholder: "Email",
phoneLabel: "Phone",
phonePlaceholder: "Phone",
createSubmit: "Create Recipient",
updateSubmit: "Update Recipient",
createSubmit: "Create Person",
updateSubmit: "Update Person",
},
fallback: {
unknownDepartment: "Unknown department",
@@ -759,30 +751,28 @@ describe("i18n dictionaries", () => {
OTHER: "Other",
},
actions: {
createSuccess: "Recipient created successfully",
createFailure: "Failed to create recipient",
updateSuccess: "Recipient updated successfully",
updateFailure: "Failed to update recipient",
duplicateUsername: "Username already exists",
createSuccess: "Person created successfully",
createFailure: "Failed to create person",
updateSuccess: "Person updated successfully",
updateFailure: "Failed to update person",
duplicateEmail: "Email already exists",
},
schema: {
usernameRequired: "Username is required",
firstNameRequired: "First name is required",
lastNameRequired: "Last name is required",
departmentRequired: "Department is required",
emailInvalid: "Email format is invalid",
idRequired: "ID is required",
userIdInvalid: "User ID must be a valid UUID",
},
})
expect(getDictionary("es").inventory.recipients).toEqual({
expect(getDictionary("es").inventory.people).toEqual({
list: {
title: "Destinatarios",
addLabel: "Agregar destinatario",
empty: "No se encontraron destinatarios.",
title: "Personas",
addLabel: "Agregar persona",
empty: "No se encontraron personas.",
columns: {
username: "Usuario",
name: "Nombre",
email: "Correo electrónico",
phone: "Teléfono",
@@ -790,29 +780,26 @@ describe("i18n dictionaries", () => {
actions: "Acciones",
},
actions: {
view: "Ver destinatario",
edit: "Editar destinatario",
view: "Ver persona",
edit: "Editar persona",
},
},
detail: {
notFound: "Destinatario no encontrado",
notFound: "Persona no encontrada",
labels: {
username: "Usuario",
email: "Correo electrónico",
phone: "Teléfono",
department: "Departamento",
},
},
new: {
title: "Agregar destinatario",
title: "Agregar persona",
},
edit: {
title: "Editar destinatario",
notFound: "Destinatario no encontrado",
title: "Editar persona",
notFound: "Persona no encontrada",
},
form: {
usernameLabel: "Usuario",
usernamePlaceholder: "Usuario",
firstNameLabel: "Nombre",
firstNamePlaceholder: "Nombre",
lastNameLabel: "Apellido",
@@ -823,8 +810,8 @@ describe("i18n dictionaries", () => {
emailPlaceholder: "Correo electrónico",
phoneLabel: "Teléfono",
phonePlaceholder: "Teléfono",
createSubmit: "Crear destinatario",
updateSubmit: "Actualizar destinatario",
createSubmit: "Crear persona",
updateSubmit: "Actualizar persona",
},
fallback: {
unknownDepartment: "Departamento desconocido",
@@ -840,24 +827,34 @@ describe("i18n dictionaries", () => {
OTHER: "Otro",
},
actions: {
createSuccess: "Destinatario creado correctamente",
createFailure: "Error al crear el destinatario",
updateSuccess: "Destinatario actualizado correctamente",
updateFailure: "Error al actualizar el destinatario",
duplicateUsername: "El nombre de usuario ya existe",
createSuccess: "Persona creada correctamente",
createFailure: "Error al crear la persona",
updateSuccess: "Persona actualizada correctamente",
updateFailure: "Error al actualizar la persona",
duplicateEmail: "El correo electrónico ya existe",
},
schema: {
usernameRequired: "El usuario es obligatorio",
firstNameRequired: "El nombre es obligatorio",
lastNameRequired: "El apellido es obligatorio",
departmentRequired: "El departamento es obligatorio",
emailInvalid: "El correo electrónico no es válido",
idRequired: "El ID es obligatorio",
userIdInvalid: "El ID de usuario debe ser un UUID válido",
},
})
})
it("does not have inventory.recipients or legacy recipient keys in either locale", () => {
expect("recipients" in getDictionary("en").inventory).toBe(false)
expect("recipients" in getDictionary("es").inventory).toBe(false)
expect("recipients" in getDictionary("en").layout.sidebar).toBe(false)
expect("recipient" in getDictionary("en").layout.addMenu).toBe(false)
expect("recipients" in getDictionary("es").layout.sidebar).toBe(false)
expect("recipient" in getDictionary("es").layout.addMenu).toBe(false)
expect("recipients" in getDictionary("en").dashboardHome.cards).toBe(false)
expect("recipients" in getDictionary("es").dashboardHome.cards).toBe(false)
})
it("provides localized movement UI copy for English and Spanish", () => {
expect(getDictionary("en").inventory.movements).toEqual({
list: {
@@ -940,10 +937,6 @@ describe("i18n dictionaries", () => {
title: "Total Assets",
countLabel: "Total",
},
recipients: {
title: "Total Recipients",
countLabel: "Total",
},
people: {
title: "Total People",
countLabel: "Total",
@@ -962,10 +955,6 @@ describe("i18n dictionaries", () => {
title: "Total de activos",
countLabel: "Total",
},
recipients: {
title: "Total de destinatarios",
countLabel: "Total",
},
people: {
title: "Total de personas",
countLabel: "Total",