Skip to content

Commit 2a77ee5

Browse files
Andrea Barbassoatarix83
authored andcommitted
Merged in task/main-cris/DSC-2095 (pull request DSpace#3074)
[DSC-2095] fix group info not showing in eperson form page Approved-by: Giuseppe Digilio
2 parents 8fed9d7 + 5686341 commit 2a77ee5

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { CommonModule } from '@angular/common';
22
import { NO_ERRORS_SCHEMA } from '@angular/core';
33
import {
44
ComponentFixture,
5+
fakeAsync,
56
TestBed,
7+
tick,
68
waitForAsync,
79
} from '@angular/core/testing';
810
import {
@@ -63,7 +65,10 @@ import { NotificationsServiceStub } from '../../../shared/testing/notifications-
6365
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
6466
import { RouterStub } from '../../../shared/testing/router.stub';
6567
import { createPaginatedList } from '../../../shared/testing/utils.test';
66-
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
68+
import {
69+
followLink,
70+
FollowLinkConfig,
71+
} from '../../../shared/utils/follow-link-config.model';
6772
import { HasNoValuePipe } from '../../../shared/utils/has-no-value.pipe';
6873
import { EPeopleRegistryComponent } from '../epeople-registry.component';
6974
import { EPersonFormComponent } from './eperson-form.component';
@@ -576,4 +581,15 @@ describe('EPersonFormComponent', () => {
576581
expect(epersonRegistrationService.registerEmail).toHaveBeenCalledWith(ePersonEmail, null, 'forgot');
577582
});
578583
});
584+
585+
describe('findListByHref functionality', () => {
586+
it('retrieves groups and object on page change', fakeAsync(() => {
587+
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf({ _links: { groups: { href: 'groups' } } } as EPerson));
588+
589+
const options = { currentPage: 1, elementsPerPage: 5 };
590+
component.onPageChange(options.currentPage);
591+
tick();
592+
expect(groupsDataService.findListByHref).toHaveBeenCalledWith(jasmine.anything(), options, undefined, undefined, followLink('object'));
593+
}));
594+
});
579595
});

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
638638
*/
639639
private updateGroups(options) {
640640
this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => {
641-
this.groups$ = this.groupsDataService.findListByHref(eperson._links.groups.href, options);
641+
this.groups$ = this.groupsDataService.findListByHref(eperson._links.groups.href, options, undefined, undefined, followLink('object'));
642642
}));
643643
}
644644
}

0 commit comments

Comments
 (0)