diff --git a/src/app/community-page/edit-community-page/community-roles/community-roles.component.html b/src/app/community-page/edit-community-page/community-roles/community-roles.component.html index 07d5d96fcd..37a70ff403 100644 --- a/src/app/community-page/edit-community-page/community-roles/community-roles.component.html +++ b/src/app/community-page/edit-community-page/community-roles/community-roles.component.html @@ -1,5 +1,5 @@ diff --git a/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts b/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts index baea5fb9d0..9dddb87f8d 100644 --- a/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts @@ -78,8 +78,9 @@ describe('CommunityRolesComponent', () => { fixture.detectChanges(); }); - it('should display a community admin role component', () => { + it('should display a community admin role component', (done) => { expect(de.query(By.css('ds-comcol-role .community-admin'))) .toBeTruthy(); + done(); }); }); diff --git a/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts b/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts index 3bb2de9a62..9468aa7048 100644 --- a/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts +++ b/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts @@ -19,28 +19,14 @@ export class CommunityRolesComponent implements OnInit { dsoRD$: Observable>; /** - * The community to manage, as an observable. + * The different roles for the community, as an observable. */ - get community$(): Observable { - return this.dsoRD$.pipe( - getFirstSucceededRemoteData(), - getRemoteDataPayload(), - ); - } + comcolRoles$: Observable; /** - * The different roles for the community. + * The community to manage, as an observable. */ - getComcolRoles$(): Observable { - return this.community$.pipe( - map((community) => [ - { - name: 'community-admin', - href: community._links.adminGroup.href, - }, - ]), - ); - } + community$: Observable; constructor( protected route: ActivatedRoute, @@ -52,5 +38,22 @@ export class CommunityRolesComponent implements OnInit { first(), map((data) => data.dso), ); + + this.community$ = this.dsoRD$.pipe( + getFirstSucceededRemoteData(), + getRemoteDataPayload(), + ); + + /** + * The different roles for the community. + */ + this.comcolRoles$ = this.community$.pipe( + map((community) => [ + { + name: 'community-admin', + href: community._links.adminGroup.href, + }, + ]), + ); } }