Skip to content

Commit 4833f3b

Browse files
authored
Merge pull request #1122 from microting/copilot/fix-broken-unit-tests-again
Fix broken unit tests in time-planning-pn components
2 parents 576f686 + fed8b75 commit 4833f3b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/assigned-site/assigned-site-dialog.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ describe('AssignedSiteDialogComponent', () => {
231231
component.copyBreakSettings('monday');
232232

233233
const mondayBreak = component.assignedSiteForm.get('autoBreakSettings')?.get('monday');
234-
expect(mondayBreak?.get('breakMinutesDivider')?.value).toBe(480);
235-
expect(mondayBreak?.get('breakMinutesPrDivider')?.value).toBe(30);
236-
expect(mondayBreak?.get('breakMinutesUpperLimit')?.value).toBe(60);
234+
expect(mondayBreak?.get('breakMinutesDivider')?.value).toBe('08:00');
235+
expect(mondayBreak?.get('breakMinutesPrDivider')?.value).toBe('00:30');
236+
expect(mondayBreak?.get('breakMinutesUpperLimit')?.value).toBe('01:00');
237237
});
238238

239239
it('should handle missing global settings gracefully', () => {

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/download-excel/download-excel-dialog.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component, Inject, Input, OnDestroy, OnInit} from '@angular/core';
2-
import {Subscription} from 'rxjs';
2+
import {EMPTY, Subscription} from 'rxjs';
33
import {MatDatepickerInputEvent} from '@angular/material/datepicker';
44
import {SiteDto} from 'src/app/common/models';
55
import {
@@ -66,7 +66,7 @@ export class DownloadExcelDialogComponent implements OnInit, OnDestroy {
6666
.pipe(catchError(
6767
(error, caught) => {
6868
this.toastrService.error('Error downloading report');
69-
return caught;
69+
return EMPTY;
7070
}))
7171
.subscribe(
7272
(data) => {
@@ -83,9 +83,9 @@ export class DownloadExcelDialogComponent implements OnInit, OnDestroy {
8383
this.downloadReportSub$ = this.workingHoursService
8484
.downloadReportAllWorkers(model)
8585
.pipe(catchError(
86-
(caught) => {
86+
(error) => {
8787
this.toastrService.error('Error downloading report');
88-
return caught;
88+
return EMPTY;
8989
}))
9090
.subscribe(
9191
(data) => {

0 commit comments

Comments
 (0)