From 152596e9d47adf964a7fdbdf6e5fe44212724062 Mon Sep 17 00:00:00 2001 From: hchia444 <82906853+hchia444@users.noreply.github.com> Date: Wed, 28 Dec 2022 16:13:37 -0500 Subject: [PATCH] Update us-08-change-existing-reservation.test.js (#171) --- .../test/us-08-change-existing-reservation.test.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/back-end/test/us-08-change-existing-reservation.test.js b/back-end/test/us-08-change-existing-reservation.test.js index f42ed97033..fd34adcbaf 100644 --- a/back-end/test/us-08-change-existing-reservation.test.js +++ b/back-end/test/us-08-change-existing-reservation.test.js @@ -40,7 +40,7 @@ describe("US-08 - Change an existing reservation", () => { }); test("updates the reservation", async () => { - const expected = { + const data = { first_name: "Mouse", last_name: "Whale", mobile_number: "1231231235", @@ -55,7 +55,7 @@ describe("US-08 - Change an existing reservation", () => { expect(reservation).not.toBeUndefined(); - Object.entries(expected).forEach( + Object.entries(data).forEach( ([key, value]) => (reservation[key] = value) ); @@ -67,9 +67,10 @@ describe("US-08 - Change an existing reservation", () => { expect(response.body.error).toBeUndefined(); expect(response.body.data).toEqual( expect.objectContaining({ - ...expected, - reservation_date: expect.stringMatching(expected.reservation_date), - reservation_time: expect.stringMatching(expected.reservation_time), + first_name: "Mouse", + last_name: "Whale", + mobile_number: "1231231235", + people: 2, }) ); expect(response.status).toBe(200);