From: Mathieu Suen Date: Mon, 25 Sep 2023 12:02:36 +0000 (+0200) Subject: [NO JIRA] Fix frontend test X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8782f3924c72c1afbb0a021cd7fb44e1d12fe2ed;p=sonarqube.git [NO JIRA] Fix frontend test --- diff --git a/server/sonar-web/src/main/js/apps/overview/components/__tests__/LeakPeriodLegend-test.tsx b/server/sonar-web/src/main/js/apps/overview/components/__tests__/LeakPeriodLegend-test.tsx index dac366c5566..c7de366aa90 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/__tests__/LeakPeriodLegend-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/__tests__/LeakPeriodLegend-test.tsx @@ -27,7 +27,11 @@ import { LeakPeriodLegend } from '../LeakPeriodLegend'; jest.mock('date-fns', () => { const actual = jest.requireActual('date-fns'); - return { ...actual, differenceInDays: jest.fn().mockReturnValue(10) }; + return { + ...actual, + differenceInDays: jest.fn().mockReturnValue(10), + differenceInYears: jest.fn().mockReturnValue(-9), + }; }); it('10 days', async () => {