[ARVADOS-WORKBENCH2] updated: 1.4.1-210-g6183e022

Git user git at public.arvados.org
Fri Jan 17 23:41:46 UTC 2020


Summary of changes:
 package.json                                             |  2 +-
 .../common-service/common-resource-service.test.ts       | 16 ++++++++++++++++
 src/store/data-explorer/data-explorer-middleware.test.ts |  2 +-
 src/websocket/websocket.ts                               |  2 --
 yarn.lock                                                |  8 ++++----
 5 files changed, 22 insertions(+), 8 deletions(-)

       via  6183e0220cbde9d020a9ebac412732a5ed41583a (commit)
       via  7ea638f63582f5c9b6ab696c3dcb1855778d2432 (commit)
       via  54a8b76f902f6f66f1383ed2c7caa9244893cd69 (commit)
      from  ef7c2ceaefcf2a999a3fff5a0f6c88a4ff297382 (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 6183e0220cbde9d020a9ebac412732a5ed41583a
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Fri Jan 17 20:38:22 2020 -0300

    15672: Adds unit test to API's list request with method=POST.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/package.json b/package.json
index 93b6bb0f..26ab0800 100644
--- a/package.json
+++ b/package.json
@@ -91,7 +91,7 @@
     "@types/redux-devtools": "3.0.44",
     "@types/sinon": "7.5",
     "@types/uuid": "3.4.4",
-    "axios-mock-adapter": "1.15.0",
+    "axios-mock-adapter": "1.17.0",
     "enzyme": "3.6.0",
     "enzyme-adapter-react-16": "1.5.0",
     "jest-localstorage-mock": "2.2.0",
diff --git a/src/services/common-service/common-resource-service.test.ts b/src/services/common-service/common-resource-service.test.ts
index 41a584fd..a53ec400 100644
--- a/src/services/common-service/common-resource-service.test.ts
+++ b/src/services/common-service/common-resource-service.test.ts
@@ -41,10 +41,13 @@ describe("CommonResourceService", () => {
     });
 
     it("#create maps request params to snake case", async () => {
+        const realPost = axiosInstance.post;
         axiosInstance.post = jest.fn(() => Promise.resolve({data: {}}));
         const commonResourceService = new CommonResourceService(axiosInstance, "resource", actions);
         await commonResourceService.create({ ownerUuid: "ownerUuidValue" });
         expect(axiosInstance.post).toHaveBeenCalledWith("/resource", {owner_uuid: "ownerUuidValue"});
+        // Restore post function so that tests below don't break.
+        axiosInstance.post = realPost;
     });
 
     it("#delete", async () => {
@@ -110,4 +113,17 @@ describe("CommonResourceService", () => {
             itemsAvailable: 20
         });
     });
+
+    it("#list using POST when query string is too big", async () => {
+        axiosMock
+            .onPost("/resource")
+            .reply(200);
+        const tooBig = 'x'.repeat(1500);
+        const commonResourceService = new CommonResourceService(axiosInstance, "resource", actions);
+        const resource = await commonResourceService.list({ filters: tooBig });
+        expect(axiosMock.history.get.length).toBe(0);
+        expect(axiosMock.history.post.length).toBe(1);
+        expect(axiosMock.history.post[0].data.get('filters')).toBe('['+tooBig+']');
+        expect(axiosMock.history.post[0].params._method).toBe('GET');
+    });
 });
diff --git a/yarn.lock b/yarn.lock
index fd0fa519..e6e1989f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -996,10 +996,10 @@ aws4@^1.8.0:
   resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
   integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
 
-axios-mock-adapter at 1.15.0:
-  version "1.15.0"
-  resolved "https://registry.yarnpkg.com/axios-mock-adapter/-/axios-mock-adapter-1.15.0.tgz#fbc06825d8302c95c3334d21023bba996255d45d"
-  integrity sha1-+8BoJdgwLJXDM00hAju6mWJV1F0=
+axios-mock-adapter at 1.17.0:
+  version "1.17.0"
+  resolved "https://registry.yarnpkg.com/axios-mock-adapter/-/axios-mock-adapter-1.17.0.tgz#0dbee43c606d4aaba5a43d88d96d6661a7cc3c04"
+  integrity sha512-q3efmwJUOO4g+wsLNSk9Ps1UlJoF3fQ3FSEe4uEEhkRtu7SoiAVPj8R3Hc/WP55MBTVFzaDP9QkdJhdVhP8A1Q==
   dependencies:
     deep-equal "^1.0.1"
 

commit 7ea638f63582f5c9b6ab696c3dcb1855778d2432
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Fri Jan 17 13:40:36 2020 -0300

    15672: Fixes test
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/store/data-explorer/data-explorer-middleware.test.ts b/src/store/data-explorer/data-explorer-middleware.test.ts
index 4a858c27..17edba52 100644
--- a/src/store/data-explorer/data-explorer-middleware.test.ts
+++ b/src/store/data-explorer/data-explorer-middleware.test.ts
@@ -64,7 +64,7 @@ describe("DataExplorerMiddleware", () => {
         const next = jest.fn();
         const middleware = dataExplorerMiddleware(service)(api)(next);
         middleware(dataExplorerActions.REQUEST_ITEMS({ id: "ServiceId" }));
-        expect(config.requestItems).toHaveBeenCalled();
+        expect(api.dispatch).toHaveBeenCalledTimes(1);
     });
 
     it("handles SET_PAGE action", () => {

commit 54a8b76f902f6f66f1383ed2c7caa9244893cd69
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Wed Jan 15 19:21:37 2020 -0300

    15672: Removes commented out imports.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/websocket/websocket.ts b/src/websocket/websocket.ts
index 3e740256..7895644f 100644
--- a/src/websocket/websocket.ts
+++ b/src/websocket/websocket.ts
@@ -9,10 +9,8 @@ import { WebSocketService } from './websocket-service';
 import { ResourceEventMessage } from './resource-event-message';
 import { ResourceKind } from '~/models/resource';
 import { loadProcess } from '~/store/processes/processes-actions';
-// import { loadContainers } from '~/store/processes/processes-actions';
 import { LogEventType } from '~/models/log';
 import { addProcessLogsPanelItem } from '../store/process-logs-panel/process-logs-panel-actions';
-// import { FilterBuilder } from "~/services/api/filter-builder";
 import { subprocessPanelActions } from "~/store/subprocess-panel/subprocess-panel-actions";
 import { projectPanelActions } from "~/store/project-panel/project-panel-action";
 import { getProjectPanelCurrentUuid } from '~/store/project-panel/project-panel-action';

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list