mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3263] added extra options to upload file for upload service (#3546)
This commit is contained in:
@@ -186,7 +186,7 @@ describe('UploadService', () => {
|
||||
expect(uploadFileSpy).toHaveBeenCalledWith({
|
||||
name: 'fake-name',
|
||||
size: 10
|
||||
}, undefined, undefined, null, {
|
||||
}, undefined, undefined, { newVersion: true }, {
|
||||
renditions: 'doclib',
|
||||
include: [ 'allowableOperations' ],
|
||||
overwrite: true,
|
||||
@@ -222,6 +222,39 @@ describe('UploadService', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should append to the request the extra upload options', () => {
|
||||
let uploadFileSpy = spyOn(alfrescoApiService.getInstance().upload, 'uploadFile').and.callThrough();
|
||||
let emitter = new EventEmitter();
|
||||
|
||||
let filesFake = new FileModel(
|
||||
<File> { name: 'fake-name', size: 10 },
|
||||
<FileUploadOptions> { parentId: '123', path: 'fake-dir',
|
||||
secondaryChildren: [{ assocType: 'assoc-1', childId: 'child-id' }],
|
||||
association: { assocType: 'fake-assoc' },
|
||||
targets: [{ assocType: 'target-assoc', targetId: 'fake-target-id' }]
|
||||
}
|
||||
);
|
||||
service.addToQueue(filesFake);
|
||||
service.uploadFilesInTheQueue(emitter);
|
||||
|
||||
expect(uploadFileSpy).toHaveBeenCalledWith({
|
||||
name: 'fake-name',
|
||||
size: 10
|
||||
}, 'fake-dir', '123', {
|
||||
newVersion: false,
|
||||
parentId: '123',
|
||||
path: 'fake-dir',
|
||||
secondaryChildren: [
|
||||
{ assocType: 'assoc-1', childId: 'child-id' }],
|
||||
association: { assocType: 'fake-assoc' },
|
||||
targets: [{ assocType: 'target-assoc', targetId: 'fake-target-id' }]
|
||||
}, {
|
||||
renditions: 'doclib',
|
||||
include: ['allowableOperations'],
|
||||
autoRename: true
|
||||
});
|
||||
});
|
||||
|
||||
it('should start downloading the next one if a file of the list is aborted', (done) => {
|
||||
let emitter = new EventEmitter();
|
||||
|
||||
|
Reference in New Issue
Block a user