Skip to content

The open alternative to Salesforce, designed for AI.

Fix formatDateString test (#11786)

Lucas Bordeaufda793ced255
diff --git a/packages/twenty-front/src/utils/string/__tests__/formatDateString.test.ts b/packages/twenty-front/src/utils/string/__tests__/formatDateString.test.ts
index a88d7f61f86..8841ec97e1d 100644
--- a/packages/twenty-front/src/utils/string/__tests__/formatDateString.test.ts
+++ b/packages/twenty-front/src/utils/string/__tests__/formatDateString.test.ts
@@ -28,14 +28,8 @@ describe('formatDateString', () => {
});
it('should format date as relative when displayFormat is set to RELATIVE', () => {
- const mockDate = DateTime.now().minus({ months: 2 }).toISO();
- const mockRelativeDate = 'about 2 months ago';
-
- jest.mock('@/localization/utils/formatDateISOStringToRelativeDate', () => ({
- formatDateISOStringToRelativeDate: jest
- .fn()
- .mockReturnValue(mockRelativeDate),
- }));
+ const mockDate = DateTime.now().minus({ days: 2 }).toISO();
+ const mockRelativeDate = '2 days ago';
const result = formatDateString({
...defaultParams,
diff --git a/packages/twenty-front/src/utils/string/__tests__/formatDateTimeString.test.ts b/packages/twenty-front/src/utils/string/__tests__/formatDateTimeString.test.ts
index 69ba8c54c6b..d14fbe6164c 100644
--- a/packages/twenty-front/src/utils/string/__tests__/formatDateTimeString.test.ts
+++ b/packages/twenty-front/src/utils/string/__tests__/formatDateTimeString.test.ts
@@ -30,14 +30,8 @@ describe('formatDateTimeString', () => {
});
it('should format date as relative when displayFormat is RELATIVE', () => {
- const mockDate = DateTime.now().minus({ months: 2 }).toISO();
- const mockRelativeDate = 'about 2 months ago';
-
- jest.mock('@/localization/utils/formatDateISOStringToRelativeDate', () => ({
- formatDateISOStringToRelativeDate: jest
- .fn()
- .mockReturnValue(mockRelativeDate),
- }));
+ const mockDate = DateTime.now().minus({ days: 2 }).toISO();
+ const mockRelativeDate = '2 days ago';
const result = formatDateTimeString({
...defaultParams,