Skip to content

Commit

Permalink
Update us-08-change-existing-reservation.test.js (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
hchia444 authored Dec 28, 2022
1 parent f4cb87f commit 152596e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions back-end/test/us-08-change-existing-reservation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
);

Expand All @@ -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);
Expand Down

0 comments on commit 152596e

Please sign in to comment.