[AAE-9464] - Fetch image from ACS only in case of ECM (#7779)

This commit is contained in:
Ardit Domi
2022-08-30 09:40:17 +02:00
committed by GitHub
parent 6f209726e9
commit 147fb56724
2 changed files with 12 additions and 2 deletions

View File

@@ -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', () => {

View File

@@ -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();
}