Skip to content

Commit

Permalink
[AAE-4624] - fix user initials for identity user with bpm (#6717)
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviuCPopa authored Feb 23, 2021
1 parent 20500bb commit d4b3e82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/core/userinfo/components/user-info.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
data-automation-id="adf-user-profile">
<div class="adf-userinfo-button-profile" id="user-profile">
<div *ngIf="identityUser$ | async as identityUser; else showBpmAndEcmUserImage" id="identity-user-image">
<div *ngIf="ecmUser$ | async as ecmUser">
<div *ngIf="ecmUser.avatarId; else initialTemplate" class="adf-userinfo-profile-container">
<div *ngIf="ecmUser$ | async as ecmUser; else initialTemplate">
<div *ngIf="ecmUser.avatarId" class="adf-userinfo-profile-container">
<img id="logged-user-img" [src]="getEcmAvatar(ecmUser.avatarId)" alt="user-info-profile-button"
class="adf-userinfo-profile-image"/>
</div>
Expand Down
8 changes: 8 additions & 0 deletions lib/core/userinfo/components/user-info.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ describe('User info component', () => {
getCurrentUserInfoStub = spyOn(identityUserService, 'getCurrentUserInfo').and.returnValue(identityUserMock);
}));

it('should show the identity user initials if is not ecm user', async () => {
fixture.detectChanges();
await fixture.whenStable();
fixture.detectChanges();
expect(element.querySelector('#userinfo_container')).toBeDefined();
expect(element.querySelector('#user-initials-image').textContent).toContain('ff');
});

it('should able to fetch identity userInfo', async(() => {
fixture.detectChanges();

Expand Down

0 comments on commit d4b3e82

Please sign in to comment.