Skip to content

Commit

Permalink
tests failed, checking if changes made to test consultant were the cause
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaBonde committed Jan 10, 2025
1 parent ea0d5b7 commit 2fe421e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions frontend/mockdata/mockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const MockWeeklyBookingReadModel: WeeklyBookingReadModel = {
totalSellableTime: 0,
totalBillable: 0,
totalOffered: 0,
totalVacationHours: 10,
totalVacationHours: 0,
totalExcludableAbsence: 0,
totalNotStartedOrQuit: 0,
};
Expand Down Expand Up @@ -79,11 +79,11 @@ export const MockConsultants: ConsultantReadModel[] = [
department: { id: "mydepartment", name: "My Department" },
bookings: [
{
year: 2025,
weekNumber: 14,
year: 2023,
weekNumber: 10,
dateString: "",
bookingModel: MockWeeklyBookingReadModel,
sortableWeek: 202514,
sortableWeek: 202310,
},
],
yearsOfExperience: 23,
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/Forecast/TransformWeekDataToMonth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ function transformToMonthlyData(weeklyData: BookedHoursPerWeek[]) {
const { year, weekNumber, bookingModel } = week;
const monthDistribution = getMonthOfWeek({ week: weekNumber, year: year });
const primaryMonthKey = `${monthDistribution.year}-${String(
monthDistribution.month + 1,
monthDistribution.month,
).padStart(2, "0")}`;
const secondaryMonthKey =
monthDistribution.secondMonth !== undefined
? `${monthDistribution.year}-${String(
monthDistribution.secondMonth + 1,
monthDistribution.secondMonth,
).padStart(2, "0")}`
: null;

Expand Down Expand Up @@ -76,6 +76,7 @@ function transformToMonthlyData(weeklyData: BookedHoursPerWeek[]) {
addToMonthlyData(secondaryMonthKey, secondaryBookingModel!);
}
});
console.log("monthlyData", Object.values(monthlyData));
return Object.values(monthlyData);
}

Expand Down

0 comments on commit 2fe421e

Please sign in to comment.