fix JournalIssueComponent tests

This commit is contained in:
Enea Jahollari
2023-09-28 19:41:35 +02:00
parent 4374f284d9
commit 7447b64e61

View File

@@ -50,6 +50,9 @@ import { ItemComponent } from './item.component';
import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { APP_CONFIG } from '../../../../../config/app-config.interface';
import { provideMockStore } from '@ngrx/store/testing'; import { provideMockStore } from '@ngrx/store/testing';
import { routeServiceStub } from '../../../../shared/testing/route-service.stub'; import { routeServiceStub } from '../../../../shared/testing/route-service.stub';
import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service';
import { AuthService } from '../../../../core/auth/auth.service';
import { AuthServiceStub } from '../../../../shared/testing/auth-service.stub';
export function getIIIFSearchEnabled(enabled: boolean): MetadataValue { export function getIIIFSearchEnabled(enabled: boolean): MetadataValue {
@@ -133,7 +136,7 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
}, },
provideMockStore(), provideMockStore(),
{ provide: ItemDataService, useValue: {} }, { provide: ItemDataService, useValue: {} },
{ provide: TruncatableService, useValue: {} }, { provide: TruncatableService, useValue: mockTruncatableService },
{ provide: RelationshipDataService, useValue: relationshipService }, { provide: RelationshipDataService, useValue: relationshipService },
{ provide: ObjectCacheService, useValue: {} }, { provide: ObjectCacheService, useValue: {} },
{ provide: UUIDService, useValue: {} }, { provide: UUIDService, useValue: {} },
@@ -150,13 +153,14 @@ export function getItemPageFieldsTest(mockItem: Item, component) {
{ provide: WorkspaceitemDataService, useValue: {} }, { provide: WorkspaceitemDataService, useValue: {} },
{ provide: SearchService, useValue: {} }, { provide: SearchService, useValue: {} },
{ provide: RouteService, useValue: routeServiceStub }, { provide: RouteService, useValue: routeServiceStub },
{ provide: AuthService, useValue: new AuthServiceStub() },
{ provide: AuthorizationDataService, useValue: authorizationService }, { provide: AuthorizationDataService, useValue: authorizationService },
{ provide: ResearcherProfileDataService, useValue: {} }, { provide: ResearcherProfileDataService, useValue: {} },
{ provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub },
], ],
schemas: [NO_ERRORS_SCHEMA] schemas: [NO_ERRORS_SCHEMA]
}).overrideComponent(component, { }).overrideComponent(component, {
set: { changeDetection: ChangeDetectionStrategy.Default } add: { changeDetection: ChangeDetectionStrategy.Default }
}).compileComponents(); }).compileComponents();
})); }));
@@ -451,7 +455,7 @@ describe('ItemComponent', () => {
], ],
providers: [ providers: [
{ provide: ItemDataService, useValue: {} }, { provide: ItemDataService, useValue: {} },
{ provide: TruncatableService, useValue: {} }, { provide: TruncatableService, useValue: mockTruncatableService },
{ provide: RelationshipDataService, useValue: {} }, { provide: RelationshipDataService, useValue: {} },
{ provide: ObjectCacheService, useValue: {} }, { provide: ObjectCacheService, useValue: {} },
{ provide: UUIDService, useValue: {} }, { provide: UUIDService, useValue: {} },