[CST-7604] test cases update

This commit is contained in:
Nikunj Sharma
2023-01-11 02:46:20 +05:30
parent b7b2803f6e
commit 5660e7dc70
3 changed files with 282 additions and 7 deletions

View File

@@ -9,11 +9,19 @@ export class DSONameServiceMock {
public getHitHighlights(object: any, dso: DSpaceObject) {
if (object.hitHighlights && object.hitHighlights['dc.title']) {
return object.hitHighlights['dc.title'][0];
return object.hitHighlights['dc.title'][0].value;
} else if (object.hitHighlights && object.hitHighlights['organization.legalName']) {
return object.hitHighlights['organization.legalName'][0];
return object.hitHighlights['organization.legalName'][0].value;
} else if (object.hitHighlights && (object.hitHighlights['person.familyName'] || object.hitHighlights['person.givenName'])) {
return `${object.hitHighlights['person.familyName'][0] || ''}, ${object.hitHighlights['person.givenName'][0] || ''}`;
if (object.hitHighlights['person.familyName'] && object.hitHighlights['person.givenName']) {
return `${object.hitHighlights['person.familyName'][0].value}, ${object.hitHighlights['person.givenName'][0].value}`;
}
if (object.hitHighlights['person.familyName']) {
return `${object.hitHighlights['person.familyName'][0].value}`;
}
if (object.hitHighlights['person.givenName']) {
return `${object.hitHighlights['person.givenName'][0].value}`;
}
}
return UNDEFINED_NAME;
}