diff --git a/lib/core/src/lib/userinfo/components/user-info.component.spec.ts b/lib/core/src/lib/userinfo/components/user-info.component.spec.ts index 7b52b2f97f..7dc7c4195c 100644 --- a/lib/core/src/lib/userinfo/components/user-info.component.spec.ts +++ b/lib/core/src/lib/userinfo/components/user-info.component.spec.ts @@ -527,7 +527,7 @@ describe('User info component', () => { expect(fullNameElement.textContent).not.toContain('null'); }); - it('should not show initials if the user have avatar', async () => { + it('should not show initials if the user have avatar and provider is ECM', async () => { getCurrentUserInfoStub.and.returnValue(identityUserWithOutLastNameMock); getCurrenEcmtUserInfoStub.and.returnValue(of(fakeEcmUser)); isEcmLoggedInStub.and.returnValue(true); @@ -537,6 +537,16 @@ describe('User info component', () => { expect(element.querySelector('.adf-userinfo-profile-image')).toBeDefined(); expect(element.querySelector('.adf-userinfo-profile-image')).not.toBeNull(); }); + + it('should show initials if the user has avatar but provider is not ECM', async () => { + getCurrentUserInfoStub.and.returnValue(identityUserWithOutLastNameMock); + getCurrenEcmtUserInfoStub.and.returnValue(of(fakeEcmUser)); + isEcmLoggedInStub.and.returnValue(false); + await whenFixtureReady(); + + expect(element.querySelector('.adf-userinfo-pic')).not.toBeNull(); + expect(element.querySelector('.adf-userinfo-profile-image')).toBeNull(); + }); }); describe('kerberos', () => { diff --git a/lib/core/src/lib/userinfo/components/user-info.component.ts b/lib/core/src/lib/userinfo/components/user-info.component.ts index 297bb0f05c..b84a9ef5ff 100644 --- a/lib/core/src/lib/userinfo/components/user-info.component.ts +++ b/lib/core/src/lib/userinfo/components/user-info.component.ts @@ -90,7 +90,7 @@ export class UserInfoComponent implements OnInit, OnDestroy { this.loadIdentityUserInfo(); this.mode = 'SSO'; - if (this.authService.isEcmLoggedIn()) { + if (this.authService.isECMProvider() && this.authService.isEcmLoggedIn()) { this.loadEcmUserInfo(); }