[ACS-6222] Fixed missing display name for groups (#9034)

* [ACS-6222] fixed missing display name for groups

* [ACS-6222] cr fix
This commit is contained in:
Mykyta Maliarchuk
2023-10-27 15:43:43 +02:00
committed by GitHub
parent 2d3175ef4a
commit b847383249
2 changed files with 16 additions and 1 deletions

View File

@@ -104,6 +104,21 @@ describe('UserNameColumnComponent', () => {
expect(element.querySelector('[title="fake authority"]').textContent.trim()).toBe('fake authority');
});
it('should display group id when display name is not provided', () => {
component.context = {
row: {
obj: {
entry: {
group: { id: 'fake_group_id' }
}
}
}
};
component.ngOnInit();
fixture.detectChanges();
expect(element.querySelector('[title="fake_group_id"]').textContent.trim()).toBe('fake_group_id');
});
it('should render group for authorityId', () => {
component.context = {
row: {

View File

@@ -72,7 +72,7 @@ export class UserNameColumnComponent implements OnInit {
private updateGroup(group: Group) {
if (group) {
this.displayText$.next(group.displayName);
this.displayText$.next(group.displayName || group.id);
}
}
}