feat/#3 change tests to run in UTC time (not working on my machine)

This commit is contained in:
survellow
2024-05-29 23:31:40 +02:00
parent 51644ec315
commit e8974758bd

View File

@ -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"));
});
});