Fix uploads from folders opened from search results

Refs #1248
This commit is contained in:
Will Abson
2016-12-16 17:52:57 +00:00
parent 2bed309023
commit fb851271e9
8 changed files with 101 additions and 21 deletions

View File

@@ -121,7 +121,7 @@ describe('Test ng2-alfresco-upload UploadButton', () => {
expect(compiled.querySelector('#uploadFolder')).toBeDefined();
});
it('should call uploadFile with the default folder', () => {
it('should call uploadFile with the default root folder', () => {
component.currentFolderPath = '/root-fake-/sites-fake/folder-fake';
component.onSuccess = null;
component._uploaderService.uploadFilesInTheQueue = jasmine.createSpy('uploadFilesInTheQueue');
@@ -129,7 +129,19 @@ describe('Test ng2-alfresco-upload UploadButton', () => {
fixture.detectChanges();
component.onFilesAdded(fakeEvent);
expect(component._uploaderService.uploadFilesInTheQueue).toHaveBeenCalledWith('/root-fake-/sites-fake/folder-fake', null);
expect(component._uploaderService.uploadFilesInTheQueue).toHaveBeenCalledWith('-root-', '/root-fake-/sites-fake/folder-fake', null);
});
it('should call uploadFile with a custom root folder', () => {
component.currentFolderPath = '/root-fake-/sites-fake/folder-fake';
component.rootFolderId = '-my-';
component.onSuccess = null;
component._uploaderService.uploadFilesInTheQueue = jasmine.createSpy('uploadFilesInTheQueue');
fixture.detectChanges();
component.onFilesAdded(fakeEvent);
expect(component._uploaderService.uploadFilesInTheQueue).toHaveBeenCalledWith('-my-', '/root-fake-/sites-fake/folder-fake', null);
});
it('should create a folder and emit an File uploaded event', (done) => {