From 003377ac1ecb321030d797a0bd5b1716d2f3cd3b Mon Sep 17 00:00:00 2001 From: Kenneth Trecy Tobias <19201.tobias.kennethtrecy.c@gmail.com> Date: Sun, 11 Sep 2022 21:21:46 +0800 Subject: [PATCH] unit(employee schedule): prepare tests to update employee schedule --- .../update(id).patch.spec.ts | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/routes/api/employee_schedule/update(id).patch.spec.ts b/routes/api/employee_schedule/update(id).patch.spec.ts index d4e283f35..c3af0b253 100644 --- a/routes/api/employee_schedule/update(id).patch.spec.ts +++ b/routes/api/employee_schedule/update(id).patch.spec.ts @@ -24,13 +24,21 @@ describe("Controller: PATCH /api/employee_schedule", () => { requester.customizeRequest({ "body": { "data": { - "type": "employee_schedule", - "id": String(employeeeSchedule.id), "attributes": { "dayName": newEmployeeeSchedule.dayName, "scheduleEnd": newEmployeeeSchedule.scheduleEnd, "scheduleStart": newEmployeeeSchedule.scheduleStart - } + }, + "id": String(employeeeSchedule.id), + "relationships": { + "user": { + "data": { + "id": String(user.id), + "type": "user" + } + } + }, + "type": "employee_schedule" } } }) @@ -55,13 +63,21 @@ describe("Controller: PATCH /api/employee_schedule", () => { requester.customizeRequest({ "body": { "data": { - "type": "employee_schedule", - "id": String(employeeeSchedule.id), "attributes": { "dayName": "tue", "scheduleEnd": newEmployeeeSchedule.scheduleEnd, "scheduleStart": newEmployeeeSchedule.scheduleStart - } + }, + "id": String(employeeeSchedule.id), + "relationships": { + "user": { + "data": { + "id": String(user.id), + "type": "user" + } + } + }, + "type": "employee_schedule" } } })