mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
display the entity type in myDSpace
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
<ng-container *ngIf="status">
|
<ng-container *ngIf="status">
|
||||||
<ds-mydspace-item-status [status]="status"></ds-mydspace-item-status>
|
<ds-mydspace-item-status [status]="status"></ds-mydspace-item-status>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
<ds-item-type-badge [object]="item"></ds-item-type-badge>
|
||||||
<ds-truncatable [id]="item.id">
|
<ds-truncatable [id]="item.id">
|
||||||
<h3 [innerHTML]="item.firstMetadataValue('dc.title') || ('mydspace.results.no-title' | translate)" [ngClass]="{'lead': true,'text-muted': !item.firstMetadataValue('dc.title')}"></h3>
|
<h3 [innerHTML]="item.firstMetadataValue('dc.title') || ('mydspace.results.no-title' | translate)" [ngClass]="{'lead': true,'text-muted': !item.firstMetadataValue('dc.title')}"></h3>
|
||||||
<div>
|
<div>
|
||||||
|
@@ -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', () => {
|
describe('ItemListPreviewComponent', () => {
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@@ -128,4 +145,16 @@ describe('ItemListPreviewComponent', () => {
|
|||||||
expect(dateField).not.toBeNull();
|
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();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user