[CST-7604] fixed text highlight on search page

This commit is contained in:
Nikunj Sharma
2022-11-18 18:09:26 +05:30
parent 7d58a1eb0a
commit 1ee3114432
2 changed files with 6 additions and 6 deletions

View File

@@ -19,9 +19,9 @@
<ds-truncatable [id]="dso.id" *ngIf="object !== undefined && object !== null">
<a *ngIf="linkType != linkTypes.None" [target]="(linkType == linkTypes.ExternalLink) ? '_blank' : '_self'" rel="noopener noreferrer"
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out"
[innerHTML]="firstMetadataValue('dc.title') || 'Undefined'"></a>
[innerHTML]="firstMetadataValue('dc.title') ?? dsoTitle"></a>
<span *ngIf="linkType == linkTypes.None" class="lead item-list-title dont-break-out"
[innerHTML]="firstMetadataValue('dc.title') || 'Undefined'"></span>
[innerHTML]="firstMetadataValue('dc.title') ?? dsoTitle"></span>
<span class="text-muted">
<ds-truncatable-part [id]="dso.id" [minLines]="1">
<ng-container *ngIf="dso.firstMetadataValue('dc.publisher') || dso.firstMetadataValue('dc.date.issued')">

View File

@@ -13,7 +13,7 @@ import { APP_CONFIG } from '../../../../../../../config/app-config.interface';
let publicationListElementComponent: ItemSearchResultListElementComponent;
let fixture: ComponentFixture<ItemSearchResultListElementComponent>;
const dcTitle = 'This is just another <em>title</em>';
const mockItemWithMetadata: ItemSearchResult = Object.assign(new ItemSearchResult(), {
indexableObject:
Object.assign(new Item(), {
@@ -22,7 +22,7 @@ const mockItemWithMetadata: ItemSearchResult = Object.assign(new ItemSearchResul
'dc.title': [
{
language: 'en_US',
value: 'This is just another title'
value: dcTitle
}
],
'dc.contributor.author': [
@@ -211,9 +211,9 @@ describe('ItemSearchResultListElementComponent', () => {
fixture.detectChanges();
});
it('should show the title', () => {
it('should show highlighted title', () => {
const titleField = fixture.debugElement.query(By.css('.item-list-title'));
expect(titleField).not.toBeNull();
expect(titleField.nativeNode.innerHTML).toEqual(dcTitle);
});
});