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
@@ -79,7 +79,7 @@ describe('ContentService', () => {
|
||||
|
||||
it('should return a valid content URL', (done) => {
|
||||
authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||
expect(contentService.getContentUrl(node)).toBe('http://localhost:9876/ecm/alfresco/api/' +
|
||||
expect(contentService.getContentUrl(node)).toContain('/ecm/alfresco/api/' +
|
||||
'-default-/public/alfresco/versions/1/nodes/fake-node-id/content?attachment=false&alf_ticket=fake-post-ticket');
|
||||
done();
|
||||
});
|
||||
@@ -94,7 +94,7 @@ describe('ContentService', () => {
|
||||
it('should return a valid thumbnail URL', (done) => {
|
||||
authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||
expect(contentService.getDocumentThumbnailUrl(node))
|
||||
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco' +
|
||||
.toContain('/ecm/alfresco/api/-default-/public/alfresco' +
|
||||
'/versions/1/nodes/fake-node-id/renditions/doclib/content?attachment=false&alf_ticket=fake-post-ticket');
|
||||
done();
|
||||
});
|
||||
@@ -178,19 +178,4 @@ describe('ContentService', () => {
|
||||
expect(contentService.hasPermissions(permissionNode, '!Consumer')).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Download blob', () => {
|
||||
|
||||
it('Should use native msSaveOrOpenBlob if the browser is IE', (done) => {
|
||||
|
||||
const navigatorAny: any = window.navigator;
|
||||
|
||||
navigatorAny.__defineGetter__('msSaveOrOpenBlob', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
const blob = new Blob([''], { type: 'text/html' });
|
||||
contentService.downloadBlob(blob, 'test_ie');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user