From e8974758bd018a0e3aee38726404b78232c8fddd Mon Sep 17 00:00:00 2001 From: survellow <59056368+survellow@users.noreply.github.com> Date: Wed, 29 May 2024 23:31:40 +0200 Subject: [PATCH] feat/#3 change tests to run in UTC time (not working on my machine) --- frontend/src/model/roomOccupancyList.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/model/roomOccupancyList.test.ts b/frontend/src/model/roomOccupancyList.test.ts index d4efec1..aa0a3a9 100644 --- a/frontend/src/model/roomOccupancyList.test.ts +++ b/frontend/src/model/roomOccupancyList.test.ts @@ -504,7 +504,7 @@ describe("RoomOccupancyList", () => { const shiftedTime = RoomOccupancyList["shiftTimeForwardInsideWorkday"](startTime); // assert - expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-01T23:00:00Z")); + expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-02T00:00:00Z")); }); test("don't shift time on the same day", () => { @@ -515,7 +515,7 @@ describe("RoomOccupancyList", () => { const shiftedTime = RoomOccupancyList["shiftTimeForwardInsideWorkday"](startTime); // assert - expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-02T01:00:00Z")); + expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-02T02:00:00Z")); }); test("don't shift if already inside workday", () => { @@ -526,7 +526,7 @@ describe("RoomOccupancyList", () => { const shiftedTime = RoomOccupancyList["shiftTimeForwardInsideWorkday"](startTime); // assert - expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-02T12:30:00Z")); + expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-02T13:30:00Z")); }); }); @@ -539,7 +539,7 @@ describe("RoomOccupancyList", () => { const shiftedTime = RoomOccupancyList["shiftTimeBackwardInsideWorkday"](startTime); // assert - expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-01T22:59:59.999Z")); + expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-01T23:59:59.999Z")); }); test("don't shift time on the same day", () => { @@ -550,7 +550,7 @@ describe("RoomOccupancyList", () => { const shiftedTime = RoomOccupancyList["shiftTimeBackwardInsideWorkday"](startTime); // assert - expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-02T22:00:00Z")); + expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-02T23:00:00Z")); }); test("don't shift if already inside workday", () => { @@ -561,7 +561,7 @@ describe("RoomOccupancyList", () => { const shiftedTime = RoomOccupancyList["shiftTimeBackwardInsideWorkday"](startTime); // assert - expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-02T12:30:00Z")); + expect(toZonedTime(shiftedTime, localTimezone)).toEqual(new Date("2022-01-02T13:30:00Z")); }); });