Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>
expect(webdavClient.upload.mock.calls[0][0]).toEqual("c=zzzzz-4zz18-0123456789abcde/test-file1");
});
- it('should upload files with custom uplaod target', async () => {
+ it.only('should upload files with custom uplaod target', async () => {
// given
const files: File[] = [{name: 'test-file1'} as File];
const collectionUUID = 'zzzzz-4zz18-0123456789abcde';
// then
expect(webdavClient.upload).toHaveBeenCalledTimes(1);
- expect(webdavClient.upload.mock.calls[0][0]).toEqual("c=zzzzz-4zz18-0123456789adddd/test-path//test-file1");
+ expect(webdavClient.upload.mock.calls[0][0]).toEqual("c=zzzzz-4zz18-0123456789adddd/test-path/test-file1");
});
});
}
private async uploadFile(collectionUuid: string, file: File, fileId: number, onProgress: UploadProgress = () => { return; }, targetLocation: string = '') {
- const fileURL = `c=${targetLocation !== '' ? targetLocation : collectionUuid}/${file.name}`;
+ const fileURL = `c=${targetLocation !== '' ? targetLocation : collectionUuid}/${file.name}`.replace('//', '/');
const requestConfig = {
headers: {
'Content-Type': 'text/octet-stream'