mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
65272: CollectionMetadataComponent test import fixes
This commit is contained in:
@@ -8,18 +8,30 @@ import { ActivatedRoute } from '@angular/router';
|
|||||||
import { of as observableOf } from 'rxjs/internal/observable/of';
|
import { of as observableOf } from 'rxjs/internal/observable/of';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { CollectionMetadataComponent } from './collection-metadata.component';
|
import { CollectionMetadataComponent } from './collection-metadata.component';
|
||||||
|
import { Item } from '../../../core/shared/item.model';
|
||||||
|
import { createSuccessfulRemoteDataObject$ } from '../../../shared/testing/utils';
|
||||||
|
import { ItemTemplateDataService } from '../../../core/data/item-template-data.service';
|
||||||
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
|
|
||||||
describe('CollectionMetadataComponent', () => {
|
describe('CollectionMetadataComponent', () => {
|
||||||
let comp: CollectionMetadataComponent;
|
let comp: CollectionMetadataComponent;
|
||||||
let fixture: ComponentFixture<CollectionMetadataComponent>;
|
let fixture: ComponentFixture<CollectionMetadataComponent>;
|
||||||
|
|
||||||
|
const template = new Item();
|
||||||
|
|
||||||
|
const itemTemplateService = Object.assign({
|
||||||
|
findByCollectionID: () => createSuccessfulRemoteDataObject$(template)
|
||||||
|
});
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule],
|
imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule],
|
||||||
declarations: [CollectionMetadataComponent],
|
declarations: [CollectionMetadataComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: CollectionDataService, useValue: {} },
|
{ provide: CollectionDataService, useValue: {} },
|
||||||
|
{ provide: ItemTemplateDataService, useValue: itemTemplateService },
|
||||||
{ provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: { payload: {} } }) } } },
|
{ provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: { payload: {} } }) } } },
|
||||||
|
{ provide: NotificationsService, useValue: {} }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
Reference in New Issue
Block a user