From 367eb0ed7b5acb315609c2a8c078d6c58c6a088a Mon Sep 17 00:00:00 2001 From: Ole Vester Date: Sat, 11 Jan 2025 14:11:23 +0100 Subject: [PATCH] fix course-competencies-relation-modal.component.spec.ts --- .../course-competencies-relation-modal.component.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/javascript/spec/component/competencies/components/course-competencies-relation-modal.component.spec.ts b/src/test/javascript/spec/component/competencies/components/course-competencies-relation-modal.component.spec.ts index a3a99fd7a25e..d26d525ad146 100644 --- a/src/test/javascript/spec/component/competencies/components/course-competencies-relation-modal.component.spec.ts +++ b/src/test/javascript/spec/component/competencies/components/course-competencies-relation-modal.component.spec.ts @@ -35,7 +35,7 @@ describe('CourseCompetenciesRelationModalComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [CourseCompetenciesRelationModalComponent, NoopAnimationsModule], + imports: [NoopAnimationsModule], providers: [ provideHttpClient(), provideHttpClientTesting(), @@ -116,9 +116,11 @@ describe('CourseCompetenciesRelationModalComponent', () => { expect(closeSpy).toHaveBeenCalledOnce(); }); - it('should call selectCourseCompetency on courseCompetencyRelationFormComponent with valid courseCompetencyId', () => { + it('should call selectCourseCompetency on courseCompetencyRelationFormComponent with valid courseCompetencyId', async () => { fixture.detectChanges(); + await fixture.whenStable(); + fixture.detectChanges(); // required as the viewChild is only available after effect() has run (-> second update) const courseCompetencyId = 1; const selectSpy = jest.spyOn(component['courseCompetencyRelationFormComponent'](), 'selectCourseCompetency');