Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ describe('EditRelationshipListComponent', () => {
relationshipType = Object.assign(new RelationshipType(), {
id: '1',
uuid: '1',
leftLabel: 'isAuthorOfPublication',
rightLabel: 'isPublicationOfAuthor'
leftwardType: 'isAuthorOfPublication',
rightwardType: 'isPublicationOfAuthor'
});

relationships = [
Expand Down Expand Up @@ -119,7 +119,7 @@ describe('EditRelationshipListComponent', () => {
de = fixture.debugElement;
comp.item = item;
comp.url = url;
comp.relationshipLabel = relationshipType.leftLabel;
comp.relationshipLabel = relationshipType.leftwardType;
fixture.detectChanges();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe('EditRelationshipComponent', () => {
relationshipType = Object.assign(new RelationshipType(), {
id: '1',
uuid: '1',
leftLabel: 'isAuthorOfPublication',
rightLabel: 'isPublicationOfAuthor'
leftwardType: 'isAuthorOfPublication',
rightwardType: 'isPublicationOfAuthor'
});

relationships = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ describe('ItemRelationshipsComponent', () => {
relationshipType = Object.assign(new RelationshipType(), {
id: '1',
uuid: '1',
leftLabel: 'isAuthorOfPublication',
rightLabel: 'isPublicationOfAuthor'
leftwardType: 'isAuthorOfPublication',
rightwardType: 'isPublicationOfAuthor'
});

relationships = [
Expand Down
9 changes: 4 additions & 5 deletions src/app/core/data/relationship.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { getMockRemoteDataBuildService } from '../../shared/mocks/mock-remote-da
import { of as observableOf } from 'rxjs/internal/observable/of';
import { RequestEntry } from './request.reducer';
import { RelationshipType } from '../shared/item-relationships/relationship-type.model';
import { ResourceType } from '../shared/resource-type';
import { Relationship } from '../shared/item-relationships/relationship.model';
import { RemoteData } from './remote-data';
import { getMockRequestService } from '../../shared/mocks/mock-request.service';
Expand Down Expand Up @@ -33,8 +32,8 @@ describe('RelationshipService', () => {
const relationshipType = Object.assign(new RelationshipType(), {
id: '1',
uuid: '1',
leftLabel: 'isAuthorOfPublication',
rightLabel: 'isPublicationOfAuthor'
leftwardType: 'isAuthorOfPublication',
rightwardType: 'isPublicationOfAuthor'
});

const relationship1 = Object.assign(new Relationship(), {
Expand Down Expand Up @@ -129,7 +128,7 @@ describe('RelationshipService', () => {
describe('getItemRelationshipLabels', () => {
it('should return the correct labels', () => {
service.getItemRelationshipLabels(item).subscribe((result) => {
expect(result).toEqual([relationshipType.rightLabel]);
expect(result).toEqual([relationshipType.rightwardType]);
});
});
});
Expand All @@ -144,7 +143,7 @@ describe('RelationshipService', () => {

describe('getRelatedItemsByLabel', () => {
it('should return the related items by label', () => {
service.getRelatedItemsByLabel(item, relationshipType.rightLabel).subscribe((result) => {
service.getRelatedItemsByLabel(item, relationshipType.rightwardType).subscribe((result) => {
expect(result).toEqual(relatedItems);
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/data/relationship.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ export class RelationshipService {
map(([leftItems, rightItems, relTypesCurrentPage]) => {
return relTypesCurrentPage.map((type, index) => {
if (leftItems[index].uuid === item.uuid) {
return type.leftLabel;
return type.leftwardType;
} else {
return type.rightLabel;
return type.rightwardType;
}
});
}),
Expand Down