From 7434d91d48b2a383490985fb6dee8adf0c796012 Mon Sep 17 00:00:00 2001 From: Vinicius Vieira <64455111+viniciusvieira00@users.noreply.github.com> Date: Fri, 31 May 2024 01:01:11 -0300 Subject: [PATCH] Adjust on getAggregateWorkingHours (#15137) Co-authored-by: Keith Williams --- .../core/getAggregateWorkingHours.test.ts | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/core/getAggregateWorkingHours.test.ts b/packages/core/getAggregateWorkingHours.test.ts index f775139437..0780c1e051 100644 --- a/packages/core/getAggregateWorkingHours.test.ts +++ b/packages/core/getAggregateWorkingHours.test.ts @@ -20,12 +20,14 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours, dateOverrides: [], + datesOutOfOffice: {}, }, { busy: [], timeZone: "Europe/London", workingHours, dateOverrides: [], + datesOutOfOffice: {}, }, ], null @@ -49,12 +51,14 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours, dateOverrides: [], + datesOutOfOffice: {}, }, { busy: [], timeZone: "Europe/London", workingHours, dateOverrides: [], + datesOutOfOffice: {}, }, ], "MANAGED" @@ -85,6 +89,7 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours: workingHoursA, dateOverrides: [], + datesOutOfOffice: {}, user: { isFixed: false, }, @@ -94,6 +99,7 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours: workingHoursB, dateOverrides: [], + datesOutOfOffice: {}, user: { isFixed: false, }, @@ -133,6 +139,7 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours: workingHoursA, dateOverrides: [], + datesOutOfOffice: {}, user: { isFixed: false, }, @@ -142,12 +149,13 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours: workingHoursB, dateOverrides: [], + datesOutOfOffice: {}, user: { isFixed: true, }, }, ], - "GROUP" + "COLLECTIVE" ); expect(result).toEqual([ @@ -182,6 +190,7 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours: workingHoursA, dateOverrides: [], + datesOutOfOffice: {}, user: { isFixed: true, }, @@ -191,12 +200,13 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours: workingHoursB, dateOverrides: [], + datesOutOfOffice: {}, user: { isFixed: true, }, }, ], - "GROUP" + "COLLECTIVE" ); expect(result).toEqual([...workingHoursB]); @@ -208,7 +218,7 @@ describe("getAggregateWorkingHours", () => { days: [1, 2], startTime: 0, endTime: 200, - userId: "userA", + userId: 1, }, ]; const workingHoursB: WorkingHours[] = [ @@ -216,7 +226,7 @@ describe("getAggregateWorkingHours", () => { days: [2, 3], startTime: 100, endTime: 300, - userId: "userB", + userId: 2, }, ]; const result = getAggregateWorkingHours( @@ -226,6 +236,7 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours: workingHoursA, dateOverrides: [], + datesOutOfOffice: {}, user: { isFixed: true, }, @@ -235,17 +246,18 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours: workingHoursB, dateOverrides: [], + datesOutOfOffice: {}, user: { isFixed: true, }, }, ], - "GROUP" + "MANAGED" ); expect(result).toEqual([ { - userId: "userA", + userId: 1, days: [2], startTime: 100, endTime: 200, @@ -285,6 +297,7 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours: workingHoursA, dateOverrides: [], + datesOutOfOffice: {}, user: { isFixed: true, }, @@ -294,12 +307,13 @@ describe("getAggregateWorkingHours", () => { timeZone: "Europe/London", workingHours: workingHoursB, dateOverrides: [], + datesOutOfOffice: {}, user: { isFixed: true, }, }, ], - "GROUP" + "COLLECTIVE" ); expect(result).toEqual([