From 8b636f533bcbc12e89e0049c9cda47552aadafd9 Mon Sep 17 00:00:00 2001 From: Enea Jahollari Date: Thu, 1 Jun 2023 15:41:24 +0200 Subject: [PATCH] fix bitstream list item test --- .../bitstream-list-item.component.spec.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts b/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts index 25d6a56295..906add6578 100644 --- a/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts +++ b/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts @@ -1,6 +1,12 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import {CommonModule} from '@angular/common'; +import {ComponentFixture, TestBed} from '@angular/core/testing'; +import {RouterTestingModule} from '@angular/router/testing'; +import {TranslateModule} from '@ngx-translate/core'; +import {SharedModule} from '../../shared.module'; -import { BitstreamListItemComponent } from './bitstream-list-item.component'; +import {BitstreamListItemComponent} from './bitstream-list-item.component'; +import {DSONameService} from '../../../core/breadcrumbs/dso-name.service'; +import {DSONameServiceMock} from '../../mocks/dso-name.service.mock'; describe('BitstreamListItemComponent', () => { let component: BitstreamListItemComponent; @@ -8,7 +14,9 @@ describe('BitstreamListItemComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ BitstreamListItemComponent ] + declarations: [ BitstreamListItemComponent ], + imports: [ CommonModule, SharedModule, TranslateModule, RouterTestingModule ], + providers: [{ provide: DSONameService, useValue: new DSONameServiceMock() }] }) .compileComponents(); }); @@ -16,6 +24,8 @@ describe('BitstreamListItemComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(BitstreamListItemComponent); component = fixture.componentInstance; + // @ts-ignore + component.object = {name: 'test'}; fixture.detectChanges(); });