From fb72d6981fb2d40f85a2ff70661e68ef08c1bbb1 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Tue, 27 Oct 2020 17:05:44 +0100 Subject: [PATCH] SONAR-13987 Display validation for Bitbucket server --- .../almIntegration/__tests__/AlmIntegration-test.tsx | 4 +++- .../main/js/apps/settings/components/almIntegration/utils.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmIntegration-test.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmIntegration-test.tsx index 61b13508898..fc05d4faaa6 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmIntegration-test.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/__tests__/AlmIntegration-test.tsx @@ -32,7 +32,7 @@ import { AlmIntegration } from '../AlmIntegration'; jest.mock('../../../../../api/alm-settings', () => ({ countBindedProjects: jest.fn().mockResolvedValue(0), deleteConfiguration: jest.fn().mockResolvedValue(undefined), - getAlmDefinitions: jest.fn().mockResolvedValue({ github: [], gitlab: [] }), + getAlmDefinitions: jest.fn().mockResolvedValue({ bitbucket: [], github: [], gitlab: [] }), validateAlmSettings: jest.fn().mockResolvedValue('') })); @@ -56,6 +56,8 @@ it('should validate existing configurations', async () => { await waitAndUpdate(wrapper); + expect(validateAlmSettings).toBeCalledTimes(4); + expect(validateAlmSettings).toBeCalledWith('b1'); expect(validateAlmSettings).toBeCalledWith('gh1'); expect(validateAlmSettings).toBeCalledWith('gh2'); expect(validateAlmSettings).toBeCalledWith('gl1'); diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/utils.ts b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/utils.ts index e3566634563..5de5535b294 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/utils.ts +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/utils.ts @@ -19,4 +19,4 @@ */ import { AlmKeys } from '../../../../types/alm-settings'; -export const VALIDATED_ALMS = [AlmKeys.GitHub, AlmKeys.GitLab]; +export const VALIDATED_ALMS = [AlmKeys.Bitbucket, AlmKeys.GitHub, AlmKeys.GitLab]; -- 2.39.5