[ADF-819] added snackbar to single file drop (#2051)

This commit is contained in:
Vito
2017-07-06 06:54:54 -07:00
committed by Eugenio Romano
parent b9cfa81829
commit c0002217fe
2 changed files with 27 additions and 0 deletions

View File

@@ -213,4 +213,28 @@ describe('UploadDragAreaComponent', () => {
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();
});
});

View File

@@ -135,6 +135,9 @@ export class UploadDragAreaComponent {
this.uploadService.addToQueue(fileModel);
this.uploadService.uploadFilesInTheQueue(this.onSuccess);
});
if (this.showNotificationBar) {
this.showUndoNotificationBar(item);
}
}
}