]> source.dussan.org Git - sonarqube.git/commitdiff
[NO JIRA] Fix frontend test
authorMathieu Suen <mathieu.suen@sonarsource.com>
Mon, 25 Sep 2023 12:02:36 +0000 (14:02 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 25 Sep 2023 20:02:52 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/overview/components/__tests__/LeakPeriodLegend-test.tsx

index dac366c5566895b6c2e2799c8fd29d997b8e8d24..c7de366aa906d01ff4914defd8da07b570f9c92d 100644 (file)
@@ -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 () => {