mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
emit success events on upload resume (#3824)
This commit is contained in:
committed by
Eugenio Romano
parent
ef568679d5
commit
580cd3440f
@@ -127,6 +127,26 @@ describe('UploadBase', () => {
|
||||
expect(uploadFilesInTheQueue).toHaveBeenCalled();
|
||||
}));
|
||||
|
||||
it('should emit callback events on resume', fakeAsync((done) => {
|
||||
spyOn(uploadService, 'addToQueue').and.stub();
|
||||
spyOn(uploadService, 'uploadFilesInTheQueue').and.stub();
|
||||
|
||||
let uploadEvent: UploadFilesEvent;
|
||||
component.beginUpload.subscribe(event => {
|
||||
uploadEvent = event;
|
||||
event.preventDefault();
|
||||
});
|
||||
const file = <File> { name: 'bigFile.png', size: 1000 };
|
||||
component.uploadFiles([file]);
|
||||
|
||||
tick();
|
||||
uploadEvent.resumeUpload();
|
||||
|
||||
component.success.subscribe(() => {
|
||||
done();
|
||||
});
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
describe('filesize', () => {
|
||||
|
@@ -128,7 +128,8 @@ export abstract class UploadBase implements OnInit, OnDestroy {
|
||||
this.ngZone.run(() => {
|
||||
const event = new UploadFilesEvent(
|
||||
[...filteredFiles],
|
||||
this.uploadService
|
||||
this.uploadService,
|
||||
this.success
|
||||
);
|
||||
this.beginUpload.emit(event);
|
||||
|
||||
|
Reference in New Issue
Block a user