diff --git a/frontend/src/app/components/key-result-form/key-result-form.component.spec.ts b/frontend/src/app/components/key-result-form/key-result-form.component.spec.ts index 724f517822..d0d2479b8a 100644 --- a/frontend/src/app/components/key-result-form/key-result-form.component.spec.ts +++ b/frontend/src/app/components/key-result-form/key-result-form.component.spec.ts @@ -27,6 +27,7 @@ import { KeyResultMetric } from '../../shared/types/model/KeyResultMetric'; import { KeyResultOrdinal } from '../../shared/types/model/KeyResultOrdinal'; import { TranslateTestingModule } from 'ngx-translate-testing'; import * as de from '../../../assets/i18n/de.json'; +import { Quarter } from '../../shared/types/model/Quarter'; describe('KeyResultFormComponent', () => { let component: KeyResultFormComponent; @@ -70,7 +71,7 @@ describe('KeyResultFormComponent', () => { const keyResultObjective: KeyResultObjective = { id: 2, state: State.ONGOING, - quarter: { id: 1, label: 'GJ 22/23-Q2', endDate: new Date(), startDate: new Date() }, + quarter: new Quarter(1, 'GJ 22/23-Q2', new Date(), new Date()), }; const keyResultFormGroup = new FormGroup({ diff --git a/frontend/src/app/components/quarter-filter/quarter-filter.component.spec.ts b/frontend/src/app/components/quarter-filter/quarter-filter.component.spec.ts index b81c7056e9..acec7442dc 100644 --- a/frontend/src/app/components/quarter-filter/quarter-filter.component.spec.ts +++ b/frontend/src/app/components/quarter-filter/quarter-filter.component.spec.ts @@ -2,7 +2,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { QuarterFilterComponent } from './quarter-filter.component'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { OverviewService } from '../../services/overview.service'; -import { quarter } from '../../shared/testData'; import { Observable, of } from 'rxjs'; import { Quarter } from '../../shared/types/model/Quarter'; import { QuarterService } from '../../services/quarter.service'; @@ -31,6 +30,9 @@ const quarterService = { getAllQuarters(): Observable { return of(quarters); }, + getCurrentQuarter(): Observable { + return of(quarters[2]); + }, }; describe('QuarterFilterComponent', () => { @@ -68,6 +70,7 @@ describe('QuarterFilterComponent', () => { it('should set correct default quarter if no route param is defined', async () => { jest.spyOn(component, 'changeDisplayedQuarter'); + jest.spyOn(quarters[2] as any, 'isCurrent').mockReturnValue(true); const quarterSelect = await loader.getHarness(MatSelectHarness); expect(quarterSelect).toBeTruthy(); component.ngOnInit();