From: Daniel Kutyła Date: Wed, 6 Apr 2022 20:08:41 +0000 (+0200) Subject: 18834: fixed double path separator X-Git-Tag: 2.4.1~8^2 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/52b7cea2ae6e69e5ccfebb6a393ab6054f39c552 18834: fixed double path separator Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła --- diff --git a/src/services/collection-service/collection-service.test.ts b/src/services/collection-service/collection-service.test.ts index 4aa55ef3..88c5f725 100644 --- a/src/services/collection-service/collection-service.test.ts +++ b/src/services/collection-service/collection-service.test.ts @@ -111,7 +111,7 @@ describe('collection-service', () => { 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'; @@ -122,7 +122,7 @@ describe('collection-service', () => { // 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"); }); }); diff --git a/src/services/collection-service/collection-service.ts b/src/services/collection-service/collection-service.ts index b45ae887..e5071d7e 100644 --- a/src/services/collection-service/collection-service.ts +++ b/src/services/collection-service/collection-service.ts @@ -121,7 +121,7 @@ export class CollectionService extends TrashableResourceService { 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'