Skip to content

Commit

Permalink
Adjust on getAggregateWorkingHours (#15137)
Browse files Browse the repository at this point in the history
Co-authored-by: Keith Williams <[email protected]>
  • Loading branch information
viniciusvieira00 and keithwillcode authored May 31, 2024
1 parent 890f184 commit 470fdac
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions packages/core/getAggregateWorkingHours.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours,
dateOverrides: [],
datesOutOfOffice: {},
},
{
busy: [],
timeZone: "Europe/London",
workingHours,
dateOverrides: [],
datesOutOfOffice: {},
},
],
null
Expand All @@ -49,12 +51,14 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours,
dateOverrides: [],
datesOutOfOffice: {},
},
{
busy: [],
timeZone: "Europe/London",
workingHours,
dateOverrides: [],
datesOutOfOffice: {},
},
],
"MANAGED"
Expand Down Expand Up @@ -85,6 +89,7 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours: workingHoursA,
dateOverrides: [],
datesOutOfOffice: {},
user: {
isFixed: false,
},
Expand All @@ -94,6 +99,7 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours: workingHoursB,
dateOverrides: [],
datesOutOfOffice: {},
user: {
isFixed: false,
},
Expand Down Expand Up @@ -133,6 +139,7 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours: workingHoursA,
dateOverrides: [],
datesOutOfOffice: {},
user: {
isFixed: false,
},
Expand All @@ -142,12 +149,13 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours: workingHoursB,
dateOverrides: [],
datesOutOfOffice: {},
user: {
isFixed: true,
},
},
],
"GROUP"
"COLLECTIVE"
);

expect(result).toEqual([
Expand Down Expand Up @@ -182,6 +190,7 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours: workingHoursA,
dateOverrides: [],
datesOutOfOffice: {},
user: {
isFixed: true,
},
Expand All @@ -191,12 +200,13 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours: workingHoursB,
dateOverrides: [],
datesOutOfOffice: {},
user: {
isFixed: true,
},
},
],
"GROUP"
"COLLECTIVE"
);

expect(result).toEqual([...workingHoursB]);
Expand All @@ -208,15 +218,15 @@ describe("getAggregateWorkingHours", () => {
days: [1, 2],
startTime: 0,
endTime: 200,
userId: "userA",
userId: 1,
},
];
const workingHoursB: WorkingHours[] = [
{
days: [2, 3],
startTime: 100,
endTime: 300,
userId: "userB",
userId: 2,
},
];
const result = getAggregateWorkingHours(
Expand All @@ -226,6 +236,7 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours: workingHoursA,
dateOverrides: [],
datesOutOfOffice: {},
user: {
isFixed: true,
},
Expand All @@ -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,
Expand Down Expand Up @@ -285,6 +297,7 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours: workingHoursA,
dateOverrides: [],
datesOutOfOffice: {},
user: {
isFixed: true,
},
Expand All @@ -294,12 +307,13 @@ describe("getAggregateWorkingHours", () => {
timeZone: "Europe/London",
workingHours: workingHoursB,
dateOverrides: [],
datesOutOfOffice: {},
user: {
isFixed: true,
},
},
],
"GROUP"
"COLLECTIVE"
);

expect(result).toEqual([
Expand Down

0 comments on commit 470fdac

Please sign in to comment.