From fdada805de5521a4d8ad3207185132f52d28abc3 Mon Sep 17 00:00:00 2001 From: Paul Rastoin <45004772+prastoin@users.noreply.github.com> Date: Mon, 27 Oct 2025 08:32:44 +0100 Subject: [PATCH] Central european standard timezone update fix test (#15362) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Introduction Fixing timezone flaky test, see you in 6 months --------- Co-authored-by: Félix Malfait --- .../utils/__tests__/findAvailableTimeZoneOption.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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$/); }); });