From 8b47ed8fdc1d75200f7b5fab7f2a6977d84335fd Mon Sep 17 00:00:00 2001 From: Kenneth Trecy Tobias <19201.tobias.kennethtrecy.c@gmail.com> Date: Sun, 11 Sep 2022 22:36:52 +0800 Subject: [PATCH] intg(employee schedule): modify the test to create for others --- .../api/employee_schedule/update(id).patch.spec.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/t/integration/api/employee_schedule/update(id).patch.spec.ts b/t/integration/api/employee_schedule/update(id).patch.spec.ts index c39fafc8b..dc8f87963 100644 --- a/t/integration/api/employee_schedule/update(id).patch.spec.ts +++ b/t/integration/api/employee_schedule/update(id).patch.spec.ts @@ -35,13 +35,21 @@ describe("PATCH /api/employee_schedule/:id", () => { .set("Cookie", cookie) .send({ "data": { - "type": "employee_schedule", - "id": String(employeeSchedule.id), "attributes": { "dayName": newEmployeeSchedule.dayName, "scheduleEnd": newEmployeeSchedule.scheduleEnd, "scheduleStart": newEmployeeSchedule.scheduleStart - } + }, + "id": String(employeeSchedule.id), + "relationships": { + "user": { + "data": { + "id": String(user.id), + "type": "user" + } + } + }, + "type": "employee_schedule" } }) .type(JSON_API_MEDIA_TYPE)