diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.html b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.html index bcd5c3c027..e1478b5206 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.html +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.html @@ -2,6 +2,7 @@ +

diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts index eb531d2f93..6366539157 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts @@ -47,6 +47,23 @@ const mockItemWithoutAuthorAndDate: Item = Object.assign(new Item(), { ] } }); +const mockItemWithEntityType: Item = Object.assign(new Item(), { + bundles: observableOf({}), + metadata: { + 'dc.title': [ + { + language: 'en_US', + value: 'This is just another title' + } + ], + 'relationship.type': [ + { + language: null, + value: 'Publication' + } + ] + } +}); describe('ItemListPreviewComponent', () => { beforeEach(async(() => { @@ -128,4 +145,16 @@ describe('ItemListPreviewComponent', () => { expect(dateField).not.toBeNull(); }); }); + + describe('When the item has an entity type', () => { + beforeEach(() => { + component.item = mockItemWithEntityType; + fixture.detectChanges(); + }); + + it('should show the entity type span', () => { + const entityField = fixture.debugElement.query(By.css('ds-item-type-badge')); + expect(entityField).not.toBeNull(); + }); + }); });