From ab92f94d7a9b777857ef4035193100c6bae15e9d Mon Sep 17 00:00:00 2001 From: Hghtwr Date: Sat, 23 Nov 2024 18:28:13 +0100 Subject: [PATCH] use consistent group description across all tests, remove unused handler Signed-off-by: Hghtwr --- .../src/__testUtils__/handlers.ts | 10 +--------- .../src/__testUtils__/mocks.ts | 7 +++++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts b/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts index 9b380891ae..752fd08f4b 100644 --- a/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts +++ b/plugins/catalog-backend-module-gitlab/src/__testUtils__/handlers.ts @@ -30,7 +30,6 @@ import { some_endpoint, unhealthy_endpoint, userID, - single_group_response, } from './mocks'; const httpHandlers = [ @@ -72,9 +71,6 @@ const httpHandlers = [ return res(ctx.set('x-next-page', ''), ctx.json(all_groups_response)); }), - rest.get(`${apiBaseUrl}/groups/group1`, (_req, res, ctx) => { - return res(ctx.set('x-next-page', ''), ctx.json(single_group_response)); - }), rest.get(`${apiBaseUrl}/groups/42`, (_, res, ctx) => { return res(ctx.status(500), ctx.json({ error: 'Internal Server Error' })); }), @@ -82,10 +78,6 @@ const httpHandlers = [ return res(ctx.json(all_self_hosted_group1_members)); }), - rest.get(`${apiBaseUrlSaas}/groups/group1`, (_req, res, ctx) => { - return res(ctx.set('x-next-page', ''), ctx.json(single_group_response)); - }), - rest.get(`${apiBaseUrlSaas}/groups/group1/members/all`, (_req, res, ctx) => { return res(ctx.json(all_saas_users_response)); }), @@ -506,7 +498,7 @@ const graphqlHandlers = [ { id: 'gid://gitlab/Group/1', name: 'group1', - description: '', + description: 'description1', fullPath: 'path/group1', parent: { id: '123', diff --git a/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts b/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts index faf44fd031..e91f015dd3 100644 --- a/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts +++ b/plugins/catalog-backend-module-gitlab/src/__testUtils__/mocks.ts @@ -1048,7 +1048,7 @@ export const all_groups_response: GitLabGroup[] = [ { id: 1, name: 'group1', - description: '', + description: 'description1', full_path: 'group1', }, { @@ -1118,7 +1118,7 @@ export const expectedSaasGroup: MockObject[] = [ { id: 1, name: 'group1', - description: '', + description: 'description1', full_path: 'path/group1', parent_id: 123, }, @@ -1811,6 +1811,7 @@ export const expected_group_user_entity: MockObject[] = [ 'url:https://example.com/group1', 'example.com/team-path': 'group1', }, + description: 'description1', name: 'group1', }, spec: { @@ -2097,6 +2098,7 @@ export const expected_full_org_scan_entities: MockObject[] = [ 'url:https://example.com/group1', 'example.com/team-path': 'group1', }, + description: 'description1', name: 'group1', }, spec: { @@ -2449,6 +2451,7 @@ export const expected_full_members_group_org_scan_entities: MockObject[] = [ 'url:https://example.com/group1', 'example.com/team-path': 'group1', }, + description: 'description1', name: 'group1', }, spec: {