diff --git a/packages/twenty-front/src/modules/localization/utils/__tests__/findAvailableTimeZoneOption.test.ts b/packages/twenty-front/src/modules/localization/utils/__tests__/findAvailableTimeZoneOption.test.ts index b1058e7ad6..0694d332d5 100644 --- a/packages/twenty-front/src/modules/localization/utils/__tests__/findAvailableTimeZoneOption.test.ts +++ b/packages/twenty-front/src/modules/localization/utils/__tests__/findAvailableTimeZoneOption.test.ts @@ -1,15 +1,14 @@ import { findAvailableTimeZoneOption } from '@/localization/utils/findAvailableTimeZoneOption'; -// TODO: This test is flaky, datetime retrieve in its scope, if mocked will be different than the one computed to build AVAILABLE_TIME_ZONE_OPTIONS_BY_LABEL -// We should refactor our tests to start from a controlled mocked date directly within `setupTests.ts` describe('findAvailableTimeZoneOption', () => { it('should find the matching available IANA time zone select option from a given IANA time zone', () => { const ianaTimeZone = 'Europe/Paris'; - const value = 'Europe/Paris'; - const label = '(GMT+02:00) Central European Summer Time - Paris'; const option = findAvailableTimeZoneOption(ianaTimeZone); - expect(option).toEqual({ value, label }); + expect(option).toBeDefined(); + expect(option?.value).toBe('Europe/Paris'); + // We don't test the exact label since it's time-dependent (DST changes) + expect(option?.label).toMatch(/^\(GMT[+-]\d{2}:\d{2}\) .+ - Paris$/); }); });