Restore height to process log code snippet
[arvados-workbench2.git] / src / services / groups-service / groups-service.test.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import axios from "axios";
6 import MockAdapter from "axios-mock-adapter";
7 import { GroupsService } from "./groups-service";
8
9 describe("GroupsService", () => {
10
11     const axiosMock = new MockAdapter(axios);
12
13     beforeEach(() => {
14         axiosMock.reset();
15     });
16
17     it("#contents", async () => {
18         axiosMock
19             .onGet("/groups/1/contents")
20             .reply(200, {
21                 kind: "kind",
22                 offset: 2,
23                 limit: 10,
24                 items: [{
25                     modified_at: "now"
26                 }],
27                 items_available: 20
28             });
29
30         const groupsService = new GroupsService(axios);
31         const resource = await groupsService.contents("1", { limit: 10, offset: 1 });
32         expect(resource).toEqual({
33             kind: "kind",
34             offset: 2,
35             limit: 10,
36             items: [{
37                 modifiedAt: "now"
38             }],
39             itemsAvailable: 20
40         });
41     });
42 });