This commit is contained in:
Dániel Péter Sipos
2020-11-13 16:08:52 +01:00
parent cb3131e31b
commit bb1d863470
8 changed files with 43 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
import { TruncatePipe } from '../../../utils/truncate.pipe';
import { CollectionSearchResultGridElementComponent } from './collection-search-result-grid-element.component';
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
import { LinkService } from '../../../../core/cache/builders/link.service';
let collectionSearchResultGridElementComponent: CollectionSearchResultGridElementComponent;
let fixture: ComponentFixture<CollectionSearchResultGridElementComponent>;
@@ -52,6 +53,9 @@ mockCollectionWithoutAbstract.indexableObject = Object.assign(new Collection(),
]
}
});
const linkService = jasmine.createSpyObj('linkService', {
resolveLink: mockCollectionWithAbstract
});
describe('CollectionSearchResultGridElementComponent', () => {
beforeEach(async(() => {
@@ -72,6 +76,7 @@ describe('CollectionSearchResultGridElementComponent', () => {
{ provide: DSOChangeAnalyzer, useValue: {} },
{ provide: DefaultChangeAnalyzer, useValue: {} },
{ provide: BitstreamFormatDataService, useValue: {} },
{ provide: LinkService, useValue: linkService}
],
schemas: [ NO_ERRORS_SCHEMA ]

View File

@@ -33,7 +33,6 @@ export class CollectionSearchResultGridElementComponent extends SearchResultGrid
@Input() set dso(dso: Collection) {
this._dso = dso;
console.log('aaasdasd')
if (hasValue(this._dso) && hasNoValue(this._dso.logo)) {
this.linkService.resolveLink<Collection>(
this._dso,

View File

@@ -19,6 +19,7 @@ import { TruncatableService } from '../../../truncatable/truncatable.service';
import { TruncatePipe } from '../../../utils/truncate.pipe';
import { CommunitySearchResultGridElementComponent } from './community-search-result-grid-element.component';
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
import { LinkService } from '../../../../core/cache/builders/link.service';
let communitySearchResultGridElementComponent: CommunitySearchResultGridElementComponent;
let fixture: ComponentFixture<CommunitySearchResultGridElementComponent>;
@@ -52,6 +53,9 @@ mockCommunityWithoutAbstract.indexableObject = Object.assign(new Community(), {
]
}
});
const linkService = jasmine.createSpyObj('linkService', {
resolveLink: mockCommunityWithAbstract
});
describe('CommunitySearchResultGridElementComponent', () => {
beforeEach(async(() => {
@@ -72,6 +76,7 @@ describe('CommunitySearchResultGridElementComponent', () => {
{ provide: DSOChangeAnalyzer, useValue: {} },
{ provide: DefaultChangeAnalyzer, useValue: {} },
{ provide: BitstreamFormatDataService, useValue: {} },
{ provide: LinkService, useValue: linkService}
],
schemas: [ NO_ERRORS_SCHEMA ]

View File

@@ -35,7 +35,6 @@ export class CommunitySearchResultGridElementComponent extends SearchResultGridE
@Input() set dso(dso: Community) {
this._dso = dso;
console.log('aaasdasd');
if (hasValue(this._dso) && hasNoValue(this._dso.logo)) {
this.linkService.resolveLink<Community>(this._dso, followLink('logo'));
}