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;
beforeEach(() => {
result = service.getVersions(1);
result = service.getVersions('1');
});
it('should configure a GET request', () => {
@@ -49,6 +49,6 @@ describe('VersionHistoryDataService', () => {
halService = new HALEndpointServiceStub(url);
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();
}));
beforeEach(async(() => {
beforeEach(() => {
fixture = TestBed.createComponent(OrgUnitItemMetadataListElementComponent);
comp = fixture.componentInstance;
comp.metadataRepresentation = mockItemMetadataRepresentation;
fixture.detectChanges();
}));
});
it('should show the name of the organisation as a link', () => {
const linkText = fixture.debugElement.query(By.css('a')).nativeElement.textContent;

View File

@@ -16,17 +16,17 @@ describe('ItemVersionsComponent', () => {
let fixture: ComponentFixture<ItemVersionsComponent>;
const versionHistory = Object.assign(new VersionHistory(), {
id: 1
id: '1'
});
const version1 = Object.assign(new Version(), {
id: 1,
id: '1',
version: 1,
created: new Date(2020, 1, 1),
summary: 'first version',
versionhistory: createSuccessfulRemoteDataObject$(versionHistory)
});
const version2 = Object.assign(new Version(), {
id: 2,
id: '2',
version: 2,
summary: 'second version',
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 { PaginatedSearchOptions } from '../../search/paginated-search-options.model';
import { AlertType } from '../../alert/aletr-type';
import { hasValueOperator } from '../../empty.util';
import { followLink } from '../../utils/follow-link-config.model';
@Component({
@@ -104,7 +103,7 @@ export class ItemVersionsComponent implements OnInit {
switchMap(([versionHistory, page]: [VersionHistory, number]) =>
this.versionHistoryService.getVersions(versionHistory.id,
new PaginatedSearchOptions({pagination: Object.assign({}, this.options, { currentPage: page })}),
followLink('item')))
followLink('item'), followLink('eperson')))
);
this.hasEpersons$ = this.versionsRD$.pipe(
getAllSucceededRemoteData(),