From 1ebc69c4f13a3f4e02fb742ded5ec529094709ce Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Wed, 19 Jan 2022 19:38:36 +0100 Subject: [PATCH] [NO-JIRA] Fix unit tests --- .../indexation/__tests__/IndexationNotificationHelper-test.tsx | 2 +- .../application-console/__tests__/CreateBranchForm-test.tsx | 2 +- .../js/apps/issues/sidebar/__tests__/DirectoryFacet-test.tsx | 2 +- .../main/js/apps/issues/sidebar/__tests__/FileFacet-test.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/src/main/js/app/components/indexation/__tests__/IndexationNotificationHelper-test.tsx b/server/sonar-web/src/main/js/app/components/indexation/__tests__/IndexationNotificationHelper-test.tsx index 82e53f3c821..b98ee43d3ed 100644 --- a/server/sonar-web/src/main/js/app/components/indexation/__tests__/IndexationNotificationHelper-test.tsx +++ b/server/sonar-web/src/main/js/app/components/indexation/__tests__/IndexationNotificationHelper-test.tsx @@ -28,7 +28,7 @@ beforeEach(() => { }); jest.mock('../../../../api/ce', () => ({ - getIndexationStatus: jest.fn() + getIndexationStatus: jest.fn().mockResolvedValue({}) })); jest.mock('../../../../helpers/storage', () => ({ diff --git a/server/sonar-web/src/main/js/apps/application-console/__tests__/CreateBranchForm-test.tsx b/server/sonar-web/src/main/js/apps/application-console/__tests__/CreateBranchForm-test.tsx index 383dfc1cbba..91c441bb628 100644 --- a/server/sonar-web/src/main/js/apps/application-console/__tests__/CreateBranchForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/application-console/__tests__/CreateBranchForm-test.tsx @@ -26,7 +26,7 @@ import { Application } from '../../../types/application'; import CreateBranchForm from '../CreateBranchForm'; jest.mock('../../../api/application', () => ({ - getApplicationDetails: jest.fn().mockResolvedValue({}), + getApplicationDetails: jest.fn().mockResolvedValue({ projects: [] }), addApplicationBranch: jest.fn(), updateApplicationBranch: jest.fn() })); diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/DirectoryFacet-test.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/DirectoryFacet-test.tsx index c02ffe434bb..c3e722f65ab 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/DirectoryFacet-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/DirectoryFacet-test.tsx @@ -28,7 +28,7 @@ import { Query } from '../../utils'; import DirectoryFacet from '../DirectoryFacet'; jest.mock('../../../../api/components', () => ({ - getDirectories: jest.fn().mockResolvedValue({}) + getDirectories: jest.fn().mockResolvedValue({ components: [] }) })); beforeEach(() => jest.clearAllMocks()); diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/FileFacet-test.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/FileFacet-test.tsx index 05f6cde0a30..dd55de47a1e 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/FileFacet-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/FileFacet-test.tsx @@ -28,7 +28,7 @@ import { Query } from '../../utils'; import FileFacet from '../FileFacet'; jest.mock('../../../../api/components', () => ({ - getFiles: jest.fn().mockResolvedValue({}) + getFiles: jest.fn().mockResolvedValue({ components: [] }) })); beforeEach(() => jest.clearAllMocks()); -- 2.39.5