mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-819] added snackbar to single file drop (#2051)
This commit is contained in:
@@ -213,4 +213,28 @@ describe('UploadDragAreaComponent', () => {
|
|||||||
component.onUploadFiles(fakeCustomEvent);
|
component.onUploadFiles(fakeCustomEvent);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('should show notification bar when a file is dropped', () => {
|
||||||
|
component.currentFolderPath = '/root-fake-/sites-fake/document-library-fake';
|
||||||
|
component.rootFolderId = '-my-';
|
||||||
|
component.onSuccess = null;
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
spyOn(uploadService, 'uploadFilesInTheQueue');
|
||||||
|
|
||||||
|
let itemEntity = {
|
||||||
|
fullPath: '/folder-fake/file-fake.png',
|
||||||
|
isDirectory: false,
|
||||||
|
isFile: true,
|
||||||
|
name: 'file-fake.png',
|
||||||
|
file: (callbackFile) => {
|
||||||
|
let fileFake = new File(['fakefake'], 'file-fake.png', {type: 'image/png'});
|
||||||
|
callbackFile(fileFake);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
component.onFilesEntityDropped(itemEntity);
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(document.querySelector('snack-bar-container > simple-snack-bar')).not.toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -135,6 +135,9 @@ export class UploadDragAreaComponent {
|
|||||||
this.uploadService.addToQueue(fileModel);
|
this.uploadService.addToQueue(fileModel);
|
||||||
this.uploadService.uploadFilesInTheQueue(this.onSuccess);
|
this.uploadService.uploadFilesInTheQueue(this.onSuccess);
|
||||||
});
|
});
|
||||||
|
if (this.showNotificationBar) {
|
||||||
|
this.showUndoNotificationBar(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user