mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4647] download service (#4836)
* split download api into separate service * move tests and fix code * break dependency for thumbnail service * update tests * test fixes * fix code * fix unit tests
This commit is contained in:
committed by
Eugenio Romano
parent
d0d1154f84
commit
a37f935c05
@@ -98,16 +98,8 @@ describe('EcmUserService', () => {
|
||||
spyOn(contentService, 'getContentUrl').and.callThrough();
|
||||
const urlRs = service.getUserProfileImage(undefined);
|
||||
|
||||
expect(urlRs).toBeUndefined();
|
||||
expect(urlRs).toBeNull();
|
||||
expect(contentService.getContentUrl).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should build the body for the content service', () => {
|
||||
spyOn(contentService, 'getContentUrl').and.callThrough();
|
||||
const urlRs = service.getUserProfileImage('fake-avatar-id');
|
||||
|
||||
expect(urlRs).toBeDefined();
|
||||
expect(contentService.getContentUrl).toHaveBeenCalledWith({entry: {id: 'fake-avatar-id'}});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -62,11 +62,11 @@ export class EcmUserService {
|
||||
* @param avatarId Target avatar
|
||||
* @returns Image URL
|
||||
*/
|
||||
getUserProfileImage(avatarId: string) {
|
||||
getUserProfileImage(avatarId: string): string {
|
||||
if (avatarId) {
|
||||
const nodeObj = {entry: {id: avatarId}};
|
||||
return this.contentService.getContentUrl(nodeObj);
|
||||
return this.contentService.getContentUrl(avatarId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user