68729: E-Person link on version list + test fixes

This commit is contained in:
Kristof De Langhe
2020-02-25 14:55:26 +01:00
parent 3f11ae9fa5
commit 56433d0776
4 changed files with 8 additions and 9 deletions

View File

@@ -26,7 +26,7 @@ describe('VersionHistoryDataService', () => {
let result; let result;
beforeEach(() => { beforeEach(() => {
result = service.getVersions(1); result = service.getVersions('1');
}); });
it('should configure a GET request', () => { it('should configure a GET request', () => {
@@ -49,6 +49,6 @@ describe('VersionHistoryDataService', () => {
halService = new HALEndpointServiceStub(url); halService = new HALEndpointServiceStub(url);
notificationsService = new NotificationsServiceStub(); notificationsService = new NotificationsServiceStub();
service = new VersionHistoryDataService(requestService, rdbService, null, null, objectCache, halService, notificationsService, null, null); service = new VersionHistoryDataService(requestService, rdbService, null, objectCache, halService, notificationsService, null, null);
} }
}); });

View File

@@ -27,12 +27,12 @@ describe('OrgUnitItemMetadataListElementComponent', () => {
}).compileComponents(); }).compileComponents();
})); }));
beforeEach(async(() => { beforeEach(() => {
fixture = TestBed.createComponent(OrgUnitItemMetadataListElementComponent); fixture = TestBed.createComponent(OrgUnitItemMetadataListElementComponent);
comp = fixture.componentInstance; comp = fixture.componentInstance;
comp.metadataRepresentation = mockItemMetadataRepresentation; comp.metadataRepresentation = mockItemMetadataRepresentation;
fixture.detectChanges(); fixture.detectChanges();
})); });
it('should show the name of the organisation as a link', () => { it('should show the name of the organisation as a link', () => {
const linkText = fixture.debugElement.query(By.css('a')).nativeElement.textContent; const linkText = fixture.debugElement.query(By.css('a')).nativeElement.textContent;

View File

@@ -16,17 +16,17 @@ describe('ItemVersionsComponent', () => {
let fixture: ComponentFixture<ItemVersionsComponent>; let fixture: ComponentFixture<ItemVersionsComponent>;
const versionHistory = Object.assign(new VersionHistory(), { const versionHistory = Object.assign(new VersionHistory(), {
id: 1 id: '1'
}); });
const version1 = Object.assign(new Version(), { const version1 = Object.assign(new Version(), {
id: 1, id: '1',
version: 1, version: 1,
created: new Date(2020, 1, 1), created: new Date(2020, 1, 1),
summary: 'first version', summary: 'first version',
versionhistory: createSuccessfulRemoteDataObject$(versionHistory) versionhistory: createSuccessfulRemoteDataObject$(versionHistory)
}); });
const version2 = Object.assign(new Version(), { const version2 = Object.assign(new Version(), {
id: 2, id: '2',
version: 2, version: 2,
summary: 'second version', summary: 'second version',
created: new Date(2020, 1, 2), created: new Date(2020, 1, 2),

View File

@@ -13,7 +13,6 @@ import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
import { VersionHistoryDataService } from '../../../core/data/version-history-data.service'; import { VersionHistoryDataService } from '../../../core/data/version-history-data.service';
import { PaginatedSearchOptions } from '../../search/paginated-search-options.model'; import { PaginatedSearchOptions } from '../../search/paginated-search-options.model';
import { AlertType } from '../../alert/aletr-type'; import { AlertType } from '../../alert/aletr-type';
import { hasValueOperator } from '../../empty.util';
import { followLink } from '../../utils/follow-link-config.model'; import { followLink } from '../../utils/follow-link-config.model';
@Component({ @Component({
@@ -104,7 +103,7 @@ export class ItemVersionsComponent implements OnInit {
switchMap(([versionHistory, page]: [VersionHistory, number]) => switchMap(([versionHistory, page]: [VersionHistory, number]) =>
this.versionHistoryService.getVersions(versionHistory.id, this.versionHistoryService.getVersions(versionHistory.id,
new PaginatedSearchOptions({pagination: Object.assign({}, this.options, { currentPage: page })}), new PaginatedSearchOptions({pagination: Object.assign({}, this.options, { currentPage: page })}),
followLink('item'))) followLink('item'), followLink('eperson')))
); );
this.hasEpersons$ = this.versionsRD$.pipe( this.hasEpersons$ = this.versionsRD$.pipe(
getAllSucceededRemoteData(), getAllSucceededRemoteData(),