[ARVADOS-WORKBENCH2] updated: 1.1.4-574-g2c4b577

Git user git at public.curoverse.com
Thu Aug 9 10:01:27 EDT 2018


Summary of changes:
 src/common/webdav.test.ts | 9 +++++++--
 src/common/webdav.ts      | 1 +
 2 files changed, 8 insertions(+), 2 deletions(-)

       via  2c4b5777c5bea7b862e481038566e93194b06aa9 (commit)
      from  4b7d15c94685ca3e34ebb905a4803f895367ad09 (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 2c4b5777c5bea7b862e481038566e93194b06aa9
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Aug 9 16:01:03 2018 +0200

    Add onProgress callback to PutConfig
    
    Feature #13989
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/common/webdav.test.ts b/src/common/webdav.test.ts
index 7da1585..6377168 100644
--- a/src/common/webdav.test.ts
+++ b/src/common/webdav.test.ts
@@ -27,13 +27,16 @@ describe('WebDAV', () => {
     });
 
     it('PUT', async () => {
-        const { open, send, load, createRequest } = mockCreateRequest();
+        const { open, send, load, progress, createRequest } = mockCreateRequest();
+        const onProgress = jest.fn();
         const webdav = WebDAV.create(undefined, createRequest);
-        const promise = webdav.put('foo', { data: 'Test data' });
+        const promise = webdav.put('foo', { data: 'Test data', onProgress });
+        progress();
         load();
         const request = await promise;
         expect(open).toHaveBeenCalledWith('PUT', 'foo');
         expect(send).toHaveBeenCalledWith('Test data');
+        expect(onProgress).toHaveBeenCalled();
         expect(request).toBeInstanceOf(XMLHttpRequest);
     });
 
@@ -79,10 +82,12 @@ const mockCreateRequest = () => {
     request.open = open;
     request.setRequestHeader = setRequestHeader;
     const load = () => request.dispatchEvent(new Event('load'));
+    const progress = () => request.dispatchEvent(new Event('progress'));
     return {
         send,
         open,
         load,
+        progress,
         setRequestHeader,
         createRequest: () => request
     };
diff --git a/src/common/webdav.ts b/src/common/webdav.ts
index 24dacbd..6b56f12 100644
--- a/src/common/webdav.ts
+++ b/src/common/webdav.ts
@@ -77,6 +77,7 @@ export interface PropfindConfig extends BaseConfig { }
 
 export interface PutConfig extends BaseConfig {
     data?: any;
+    onProgress?: (event: ProgressEvent) => void;
 }
 
 export interface CopyConfig extends BaseConfig {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list