mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-9464] - Fetch image from ACS only in case of ECM (#7779)
This commit is contained in:
@@ -527,7 +527,7 @@ describe('User info component', () => {
|
|||||||
expect(fullNameElement.textContent).not.toContain('null');
|
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);
|
getCurrentUserInfoStub.and.returnValue(identityUserWithOutLastNameMock);
|
||||||
getCurrenEcmtUserInfoStub.and.returnValue(of(fakeEcmUser));
|
getCurrenEcmtUserInfoStub.and.returnValue(of(fakeEcmUser));
|
||||||
isEcmLoggedInStub.and.returnValue(true);
|
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')).toBeDefined();
|
||||||
expect(element.querySelector('.adf-userinfo-profile-image')).not.toBeNull();
|
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', () => {
|
describe('kerberos', () => {
|
||||||
|
@@ -90,7 +90,7 @@ export class UserInfoComponent implements OnInit, OnDestroy {
|
|||||||
this.loadIdentityUserInfo();
|
this.loadIdentityUserInfo();
|
||||||
this.mode = 'SSO';
|
this.mode = 'SSO';
|
||||||
|
|
||||||
if (this.authService.isEcmLoggedIn()) {
|
if (this.authService.isECMProvider() && this.authService.isEcmLoggedIn()) {
|
||||||
this.loadEcmUserInfo();
|
this.loadEcmUserInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user