feat(stats): count holidays connected to weekends (#68)
This commit is contained in:
1 parent
da08ee054d
commit
06adeb12d6
9 files changed
+218
-9
No files matched your search
@@ -221,6 +221,13 @@ parentPort.on('message', (data) => globalThis.self.onmessage({ data }));
|
||||
root.querySelector<HTMLButtonElement>('.statistics-button')!.click();
|
||||
await fixture.whenStable();
|
||||
const dialog = document.querySelector('[role="dialog"]')!;
|
||||
const connectedHolidays = () =>
|
||||
Array.from(document.querySelectorAll('[role="dialog"] .statistics-summary dt'))
|
||||
.find((label) =>
|
||||
label.textContent?.includes('Jours fériés reliés à un week-end'),
|
||||
)
|
||||
?.nextElementSibling?.textContent?.trim();
|
||||
expect(connectedHolidays()).toBe('1');
|
||||
const earnedStatistics = () => [
|
||||
dialog
|
||||
.querySelector('.statistics-summary > div:last-child dt')
|
||||
@@ -258,6 +265,7 @@ parentPort.on('message', (data) => globalThis.self.onmessage({ data }));
|
||||
const trace = await calculation.trace;
|
||||
await fixture.whenStable();
|
||||
fixture.detectChanges();
|
||||
expect(connectedHolidays()).toBe('1');
|
||||
expect(earnedStatistics()).toEqual([
|
||||
'Congés acquis avant consommation (jours)',
|
||||
'1',
|
||||
@@ -292,6 +300,7 @@ parentPort.on('message', (data) => globalThis.self.onmessage({ data }));
|
||||
expect(plan.placements).toEqual(direct.placements);
|
||||
expect(plan.ifThenContributions).toEqual(direct.ifThenContributions);
|
||||
expect(plan.metrics).toEqual(direct.metrics);
|
||||
expect(plan.timeOffPeriods).toEqual(direct.timeOffPeriods);
|
||||
expect(root.textContent).toContain('Droit futur généré');
|
||||
expect(root.textContent).toContain('CP autour du férié');
|
||||
expect(root.textContent).not.toContain('Règle modifiée après calcul');
|
||||
@@ -331,6 +340,9 @@ parentPort.on('message', (data) => globalThis.self.onmessage({ data }));
|
||||
calculationDate: '2024-05-01',
|
||||
declaredDays: originalDeclarations,
|
||||
});
|
||||
root.querySelector<HTMLButtonElement>('.statistics-button')!.click();
|
||||
await fixture.whenStable();
|
||||
expect(connectedHolidays()).toBe('1');
|
||||
fixture.destroy();
|
||||
},
|
||||
);
|
||||
|
||||
@@ -134,6 +134,7 @@ export interface AppTranslations {
|
||||
averageWorkSequence: string;
|
||||
averageTimeOffPeriod: string;
|
||||
longestTimeOffPeriod: string;
|
||||
weekendConnectedHolidays: string;
|
||||
earnedLeave: string;
|
||||
earnedLeaveByRule: string;
|
||||
leaveDaysUnit: string;
|
||||
|
||||
Reference in new issue
Block a user