refactor: rename remaining recipient references to person/people
This commit is contained in:
@@ -5,7 +5,7 @@ import { es } from "@/i18n/dictionaries/es"
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
getI18n: vi.fn(),
|
||||
findAllRecipients: vi.fn(),
|
||||
findAllPeople: vi.fn(),
|
||||
findAllItemsWithStock: vi.fn(),
|
||||
findAllAvailableAssets: vi.fn(),
|
||||
findAllItems: vi.fn(),
|
||||
@@ -25,7 +25,7 @@ vi.mock("@/i18n/server", () => ({
|
||||
|
||||
vi.mock("@/services/person.service", () => ({
|
||||
PersonService: {
|
||||
findAll: mocks.findAllRecipients,
|
||||
findAll: mocks.findAllPeople,
|
||||
},
|
||||
}))
|
||||
|
||||
@@ -72,9 +72,9 @@ describe("assignment form pages localization", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
mocks.getI18n.mockResolvedValue({ dictionary: es, locale: "es" })
|
||||
mocks.findAllRecipients.mockResolvedValue([
|
||||
mocks.findAllPeople.mockResolvedValue([
|
||||
{
|
||||
id: "recipient-1",
|
||||
id: "person-1",
|
||||
firstName: "Ada",
|
||||
lastName: "Lovelace",
|
||||
},
|
||||
@@ -122,10 +122,8 @@ describe("assignment form pages localization", () => {
|
||||
const html = renderToStaticMarkup(await NewAssignmentPage())
|
||||
|
||||
expect(html).toContain("Nueva asignación")
|
||||
expect(html).toContain("Destinatario")
|
||||
expect(html).toContain(
|
||||
'option value="">Selecciona un destinatario</option>',
|
||||
)
|
||||
expect(html).toContain("Persona")
|
||||
expect(html).toContain('option value="">Selecciona una persona</option>')
|
||||
expect(html).toContain("Artículo")
|
||||
expect(html).toContain('option value="">Selecciona un artículo</option>')
|
||||
expect(html).toContain("Cantidad")
|
||||
@@ -142,7 +140,7 @@ describe("assignment form pages localization", () => {
|
||||
|
||||
mocks.findAssignmentById.mockResolvedValue({
|
||||
id: "assignment-1",
|
||||
recipientId: "recipient-1",
|
||||
personId: "person-1",
|
||||
itemId: "item-1",
|
||||
assetId: "asset-1",
|
||||
quantity: 1,
|
||||
@@ -155,7 +153,7 @@ describe("assignment form pages localization", () => {
|
||||
)
|
||||
|
||||
expect(html).toContain("Editar asignación")
|
||||
expect(html).toContain("Destinatario")
|
||||
expect(html).toContain("Persona")
|
||||
expect(html).toContain("Artículo")
|
||||
expect(html).toContain("Activo")
|
||||
expect(html).toContain('option value="">Selecciona un activo</option>')
|
||||
|
||||
@@ -5,7 +5,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest"
|
||||
import { es } from "@/i18n/dictionaries/es"
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
findAllWithRecipientPaginated: vi.fn(),
|
||||
findAllWithPersonPaginated: vi.fn(),
|
||||
getI18n: vi.fn(),
|
||||
refresh: vi.fn(),
|
||||
returnAssignment: vi.fn(),
|
||||
@@ -19,7 +19,7 @@ vi.mock("@/i18n/server", () => ({
|
||||
|
||||
vi.mock("@/services/assignment.service", () => ({
|
||||
AssignmentService: {
|
||||
findAllWithRecipientPaginated: mocks.findAllWithRecipientPaginated,
|
||||
findAllWithPersonPaginated: mocks.findAllWithPersonPaginated,
|
||||
},
|
||||
}))
|
||||
|
||||
@@ -65,13 +65,13 @@ describe("assignment pages localization", () => {
|
||||
"@/app/(dashboard)/assignments/page"
|
||||
)
|
||||
|
||||
mocks.findAllWithRecipientPaginated.mockResolvedValue({
|
||||
mocks.findAllWithPersonPaginated.mockResolvedValue({
|
||||
data: [
|
||||
{
|
||||
id: "assignment-1",
|
||||
quantity: 2,
|
||||
recipient: {
|
||||
id: "recipient-1",
|
||||
person: {
|
||||
id: "person-1",
|
||||
firstName: "Ada",
|
||||
lastName: "Lovelace",
|
||||
},
|
||||
@@ -93,7 +93,7 @@ describe("assignment pages localization", () => {
|
||||
|
||||
expect(html).toContain("Asignaciones")
|
||||
expect(html).toContain("Agregar asignación")
|
||||
expect(html).toContain("Destinatario")
|
||||
expect(html).toContain("Persona")
|
||||
expect(html).toContain("Artículo")
|
||||
expect(html).toContain("Número de serie")
|
||||
expect(html).toContain("Cantidad")
|
||||
@@ -110,7 +110,7 @@ describe("assignment pages localization", () => {
|
||||
"@/app/(dashboard)/assignments/page"
|
||||
)
|
||||
|
||||
mocks.findAllWithRecipientPaginated.mockResolvedValue({
|
||||
mocks.findAllWithPersonPaginated.mockResolvedValue({
|
||||
data: [],
|
||||
totalPages: 0,
|
||||
})
|
||||
|
||||
@@ -68,7 +68,7 @@ describe("movement pages localization", () => {
|
||||
createdAt: new Date("2026-06-13T00:00:00.000Z"),
|
||||
item: { name: "Laptop" },
|
||||
asset: { serialNumber: "SN-001" },
|
||||
recipient: { firstName: "Ada", lastName: "Lovelace" },
|
||||
person: { firstName: "Ada", lastName: "Lovelace" },
|
||||
},
|
||||
],
|
||||
totalPages: 1,
|
||||
@@ -83,7 +83,7 @@ describe("movement pages localization", () => {
|
||||
expect(html).toContain("Artículo")
|
||||
expect(html).toContain("Número de serie")
|
||||
expect(html).toContain("Cantidad")
|
||||
expect(html).toContain("Destinatario")
|
||||
expect(html).toContain("Persona")
|
||||
expect(html).toContain("Fecha")
|
||||
expect(html).toContain("Asignación")
|
||||
expect(html).toContain("Laptop")
|
||||
|
||||
Reference in New Issue
Block a user