diff --git a/src/app/shared/file-download-link/file-download-link.component.spec.ts b/src/app/shared/file-download-link/file-download-link.component.spec.ts index 9f322e9fe7..79ca42f402 100644 --- a/src/app/shared/file-download-link/file-download-link.component.spec.ts +++ b/src/app/shared/file-download-link/file-download-link.component.spec.ts @@ -10,6 +10,8 @@ import { FeatureID } from '../../core/data/feature-authorization/feature-id'; import { Item } from '../../core/shared/item.model'; import { getItemModuleRoute } from '../../item-page/item-page-routing-paths'; import { RouterLinkDirectiveStub } from '../testing/router-link-directive.stub'; +import { ActivatedRoute, RouterLink } from '@angular/router'; +import { ActivatedRouteStub } from '../testing/active-router.stub'; describe('FileDownloadLinkComponent', () => { let component: FileDownloadLinkComponent; @@ -41,12 +43,17 @@ describe('FileDownloadLinkComponent', () => { function initTestbed() { TestBed.configureTestingModule({ - imports: [FileDownloadLinkComponent], - declarations: [RouterLinkDirectiveStub], + imports: [FileDownloadLinkComponent, RouterLinkDirectiveStub], providers: [ + RouterLinkDirectiveStub, { provide: AuthorizationDataService, useValue: authorizationService }, + { provide: ActivatedRoute, useValue: new ActivatedRouteStub()} ] }) + .overrideComponent(FileDownloadLinkComponent, { + remove: {imports: [RouterLink]}, + add: {imports: [RouterLinkDirectiveStub]} + }) .compileComponents(); }