Central european standard timezone update fix test (#15362)

# Introduction
Fixing timezone flaky test, see you in 6 months

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
Paul Rastoin
2025-10-27 08:32:44 +01:00
committed by GitHub
parent d1f8d097b0
commit fdada805de
@@ -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$/);
});
});