diff --git a/src/test/javascript/spec/component/exam/manage/exercise-groups/exercise-groups.component.spec.ts b/src/test/javascript/spec/component/exam/manage/exercise-groups/exercise-groups.component.spec.ts index d46517c338eb..d7fd64238ca6 100644 --- a/src/test/javascript/spec/component/exam/manage/exercise-groups/exercise-groups.component.spec.ts +++ b/src/test/javascript/spec/component/exam/manage/exercise-groups/exercise-groups.component.spec.ts @@ -1,6 +1,6 @@ import { HttpResponse } from '@angular/common/http'; import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing'; -import { ActivatedRoute, Router, convertToParamMap, provideRouter } from '@angular/router'; +import { ActivatedRoute, Router, convertToParamMap } from '@angular/router'; import { faCheckDouble, faFileUpload, faFont, faKeyboard, faProjectDiagram } from '@fortawesome/free-solid-svg-icons'; import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { AlertService } from 'app/core/util/alert.service'; @@ -13,22 +13,12 @@ import { Exercise, ExerciseType } from 'app/entities/exercise.model'; import { ExamManagementService } from 'app/exam/manage/exam-management.service'; import { ExerciseGroupService } from 'app/exam/manage/exercise-groups/exercise-group.service'; import { ExerciseGroupsComponent } from 'app/exam/manage/exercise-groups/exercise-groups.component'; -import { FileUploadExerciseGroupCellComponent } from 'app/exam/manage/exercise-groups/file-upload-exercise-cell/file-upload-exercise-group-cell.component'; -import { ModelingExerciseGroupCellComponent } from 'app/exam/manage/exercise-groups/modeling-exercise-cell/modeling-exercise-group-cell.component'; -import { ProgrammingExerciseGroupCellComponent } from 'app/exam/manage/exercise-groups/programming-exercise-cell/programming-exercise-group-cell.component'; -import { QuizExerciseGroupCellComponent } from 'app/exam/manage/exercise-groups/quiz-exercise-cell/quiz-exercise-group-cell.component'; -import { ProgrammingExerciseInstructorStatusComponent } from 'app/exercises/programming/manage/status/programming-exercise-instructor-status.component'; -import { ExamExerciseRowButtonsComponent } from 'app/exercises/shared/exam-exercise-row-buttons/exam-exercise-row-buttons.component'; -import { HasAnyAuthorityDirective } from 'app/shared/auth/has-any-authority.directive'; -import { DeleteButtonDirective } from 'app/shared/delete-dialog/delete-button.directive'; -import { TranslateDirective } from 'app/shared/language/translate.directive'; -import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe'; import dayjs from 'dayjs/esm'; -import { MockComponent, MockDirective, MockPipe, MockProvider } from 'ng-mocks'; +import { MockProvider } from 'ng-mocks'; import { of } from 'rxjs'; import { MockRouter } from '../../../../helpers/mocks/mock-router'; -import { MockNgbModalService } from '../../../../helpers/mocks/service/mock-ngb-modal.service'; import { ArtemisTestModule } from '../../../../test.module'; +import { MockNgbModalService } from '../../../../helpers/mocks/service/mock-ngb-modal.service'; describe('Exercise Groups Component', () => { const course = new Course(); @@ -58,28 +48,10 @@ describe('Exercise Groups Component', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ArtemisTestModule], - declarations: [ - ExerciseGroupsComponent, - MockComponent(ExamExerciseRowButtonsComponent), - MockComponent(ProgrammingExerciseInstructorStatusComponent), - MockDirective(DeleteButtonDirective), - MockDirective(HasAnyAuthorityDirective), - MockPipe(ArtemisTranslatePipe), - MockComponent(FileUploadExerciseGroupCellComponent), - MockComponent(ModelingExerciseGroupCellComponent), - MockComponent(ProgrammingExerciseGroupCellComponent), - MockComponent(QuizExerciseGroupCellComponent), - MockDirective(TranslateDirective), - ], - providers: [ - provideRouter([]), - MockProvider(AlertService), - { provide: ActivatedRoute, useValue: route }, - { provide: Router, useClass: MockRouter }, - { provide: NgbModal, useClass: MockNgbModalService }, - ], + imports: [ArtemisTestModule, ExerciseGroupsComponent], + providers: [{ provide: ActivatedRoute, useValue: route }, { provide: Router, useClass: MockRouter }, MockProvider(AlertService)], }) + .overrideProvider(NgbModal, { useValue: new MockNgbModalService() }) .compileComponents() .then(() => { fixture = TestBed.createComponent(ExerciseGroupsComponent);