[ARVADOS-WORKBENCH2] updated: 2.1.0-227-gfa8284f5

Git user git at public.arvados.org
Fri Mar 26 14:17:12 UTC 2021


Summary of changes:
 src/common/webdav.test.ts | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

       via  fa8284f51d4022cd36e9db5dd3534b45f1f6b76f (commit)
      from  5642c48285c296aa3b77760ed5d1431ccdb0f2f3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit fa8284f51d4022cd36e9db5dd3534b45f1f6b76f
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date:   Fri Mar 26 15:16:28 2021 +0100

    17337: Fixed failing unit test
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>

diff --git a/src/common/webdav.test.ts b/src/common/webdav.test.ts
index b928f82a..2ab106fc 100644
--- a/src/common/webdav.test.ts
+++ b/src/common/webdav.test.ts
@@ -2,6 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
+import { customEncodeURI } from "./url";
 import { WebDAV } from "./webdav";
 
 describe('WebDAV', () => {
@@ -54,70 +55,72 @@ describe('WebDAV', () => {
     it('COPY', async () => {
         const { open, setRequestHeader, load, createRequest } = mockCreateRequest();
         const webdav = new WebDAV(undefined, createRequest);
+        webdav.defaults.baseURL = 'http://base';
         const promise = webdav.copy('foo', 'foo-copy');
         load();
         const request = await promise;
-        expect(open).toHaveBeenCalledWith('COPY', 'foo');
-        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'foo-copy');
+        expect(open).toHaveBeenCalledWith('COPY', 'http://base/foo');
+        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'http://base/foo-copy');
         expect(request).toBeInstanceOf(XMLHttpRequest);
     });
 
     it('COPY - adds baseURL with trailing slash to Destination header', async () => {
         const { open, setRequestHeader, load, createRequest } = mockCreateRequest();
         const webdav = new WebDAV(undefined, createRequest);
-        webdav.defaults.baseURL = 'base/';
+        webdav.defaults.baseURL = 'http://base';
         const promise = webdav.copy('foo', 'foo-copy');
         load();
         const request = await promise;
-        expect(open).toHaveBeenCalledWith('COPY', 'base/foo');
-        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'base/foo-copy');
+        expect(open).toHaveBeenCalledWith('COPY', 'http://base/foo');
+        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'http://base/foo-copy');
         expect(request).toBeInstanceOf(XMLHttpRequest);
     });
 
     it('COPY - adds baseURL without trailing slash to Destination header', async () => {
         const { open, setRequestHeader, load, createRequest } = mockCreateRequest();
         const webdav = new WebDAV(undefined, createRequest);
-        webdav.defaults.baseURL = 'base';
+        webdav.defaults.baseURL = 'http://base';
         const promise = webdav.copy('foo', 'foo-copy');
         load();
         const request = await promise;
-        expect(open).toHaveBeenCalledWith('COPY', 'base/foo');
-        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'base/foo-copy');
+        expect(open).toHaveBeenCalledWith('COPY', 'http://base/foo');
+        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'http://base/foo-copy');
         expect(request).toBeInstanceOf(XMLHttpRequest);
     });
 
     it('MOVE', async () => {
         const { open, setRequestHeader, load, createRequest } = mockCreateRequest();
         const webdav = new WebDAV(undefined, createRequest);
+        webdav.defaults.baseURL = 'http://base';
         const promise = webdav.move('foo', 'foo-moved');
         load();
         const request = await promise;
-        expect(open).toHaveBeenCalledWith('MOVE', 'foo');
-        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'foo-moved');
+        expect(open).toHaveBeenCalledWith('MOVE', 'http://base/foo');
+        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'http://base/foo-moved');
         expect(request).toBeInstanceOf(XMLHttpRequest);
     });
 
     it('MOVE - adds baseURL with trailing slash to Destination header', async () => {
         const { open, setRequestHeader, load, createRequest } = mockCreateRequest();
         const webdav = new WebDAV(undefined, createRequest);
-        webdav.defaults.baseURL = 'base/';
+        webdav.defaults.baseURL = 'http://base';
         const promise = webdav.move('foo', 'foo-moved');
         load();
         const request = await promise;
-        expect(open).toHaveBeenCalledWith('MOVE', 'base/foo');
-        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'base/foo-moved');
+        expect(open).toHaveBeenCalledWith('MOVE', 'http://base/foo');
+        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'http://base/foo-moved');
         expect(request).toBeInstanceOf(XMLHttpRequest);
     });
 
     it('MOVE - adds baseURL without trailing slash to Destination header', async () => {
         const { open, setRequestHeader, load, createRequest } = mockCreateRequest();
         const webdav = new WebDAV(undefined, createRequest);
-        webdav.defaults.baseURL = 'base';
+        webdav.defaults.baseURL = 'http://base';
         const promise = webdav.move('foo', 'foo-moved');
         load();
         const request = await promise;
-        expect(open).toHaveBeenCalledWith('MOVE', 'base/foo');
-        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'base/foo-moved');
+        expect(open).toHaveBeenCalledWith('MOVE', 'http://base/foo');
+        expect(setRequestHeader).toHaveBeenCalledWith('Destination', 'http://base/foo-moved');
         expect(request).toBeInstanceOf(XMLHttpRequest);
     });
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list