[arvados] updated: 2.7.0-6104-g75017b1e05

git repository hosting git at public.arvados.org
Fri Mar 1 20:17:29 UTC 2024


Summary of changes:
 .../groups-panel-middleware-service.test.ts        | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)

       via  75017b1e056df82d947db19a024c524072d0d55d (commit)
      from  a50af999abab5d1937b43437fa160d6c6a36a438 (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 75017b1e056df82d947db19a024c524072d0d55d
Author: Stephen Smith <stephen at curii.com>
Date:   Fri Mar 1 15:17:07 2024 -0500

    21221: Add unit test for failed group member count request
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/services/workbench2/src/store/groups-panel/groups-panel-middleware-service.test.ts b/services/workbench2/src/store/groups-panel/groups-panel-middleware-service.test.ts
index 810bc74bdf..42d88a9a8e 100644
--- a/services/workbench2/src/store/groups-panel/groups-panel-middleware-service.test.ts
+++ b/services/workbench2/src/store/groups-panel/groups-panel-middleware-service.test.ts
@@ -101,4 +101,60 @@ describe("GroupsPanelMiddlewareService", () => {
         expect(group?.memberCount).toBe(234);
     });
 
+    it('requests group member count and stores null on failure', async () => {
+        // Given
+        const fakeUuid = "zzzzz-j7d0g-000000000000000";
+        axiosInst.get = jest.fn((url: string) => {
+            if (url === '/groups') {
+                return Promise.resolve(
+                    { data: {
+                        kind: "",
+                        offset: 0,
+                        limit: 100,
+                        items: [{
+                            can_manage: true,
+                            can_write: true,
+                            created_at: "2023-11-15T20:57:01.723043000Z",
+                            delete_at: null,
+                            description: null,
+                            etag: "0000000000000000000000000",
+                            frozen_by_uuid: null,
+                            group_class: "role",
+                            href: `/groups/${fakeUuid}`,
+                            is_trashed: false,
+                            kind: "arvados#group",
+                            modified_at: "2023-11-15T20:57:01.719986000Z",
+                            modified_by_client_uuid: null,
+                            modified_by_user_uuid: "zzzzz-tpzed-000000000000000",
+                            name: "Test Group",
+                            owner_uuid: "zzzzz-tpzed-000000000000000",
+                            properties: {},
+                            trash_at: null,
+                            uuid: fakeUuid,
+                            writable_by: [
+                                "zzzzz-tpzed-000000000000000",
+                            ]
+                        }],
+                        items_available: 1,
+                    }} as AxiosResponse);
+            } else if (url === '/links') {
+                return Promise.reject();
+            } else {
+                return Promise.resolve({ data: {}} as AxiosResponse);
+            }
+        });
+
+        // When
+        await store.dispatch(dataExplorerActions.REQUEST_ITEMS({id: GROUPS_PANEL_ID}));
+        // Wait for async fetching of group count promises to resolve
+        await new Promise(setImmediate);
+
+        // Expect
+        expect(axiosInst.get).toHaveBeenCalledTimes(2);
+        expect(axiosInst.get).toHaveBeenCalledWith('/groups', expect.anything());
+        expect(axiosInst.get).toHaveBeenCalledWith('/links', expect.anything());
+        const group = getResource<GroupResource>(fakeUuid)(store.getState().resources);
+        expect(group?.memberCount).toBe(null);
+    });
+
 });

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list