[ARVADOS-WORKBENCH2] updated: 1.1.4-175-g8b10332

Git user git at public.curoverse.com
Mon Jul 2 06:24:30 EDT 2018


Summary of changes:
 src/services/groups-service/groups-service.test.ts | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 src/services/groups-service/groups-service.test.ts

       via  8b103324455d58bfdfa5a1108fa69acde627427e (commit)
      from  73699c70c40d2e82f1871ba042ea5d8a79cd5fd1 (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 8b103324455d58bfdfa5a1108fa69acde627427e
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Mon Jul 2 12:24:11 2018 +0200

    Create test for GroupsService
    
    Feature #13702
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/services/groups-service/groups-service.test.ts b/src/services/groups-service/groups-service.test.ts
new file mode 100644
index 0000000..2ace2f5
--- /dev/null
+++ b/src/services/groups-service/groups-service.test.ts
@@ -0,0 +1,42 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import axios from "axios";
+import MockAdapter from "axios-mock-adapter";
+import GroupsService from "./groups-service";
+
+describe("GroupsService", () => {
+
+    const axiosMock = new MockAdapter(axios);
+
+    beforeEach(() => {
+        axiosMock.reset();
+    });
+
+    it("#contents", async () => {
+        axiosMock
+            .onGet("/groups/1/contents")
+            .reply(200, {
+                kind: "kind",
+                offset: 2,
+                limit: 10,
+                items: [{
+                    modified_at: "now"
+                }],
+                items_available: 20
+            });
+
+        const groupsService = new GroupsService(axios);
+        const resource = await groupsService.contents("1", { limit: 10, offset: 1 });
+        expect(resource).toEqual({
+            kind: "kind",
+            offset: 2,
+            limit: 10,
+            items: [{
+                modifiedAt: "now"
+            }],
+            itemsAvailable: 20
+        });
+    });
+});

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list