test(front): fix main failing test due to timezone (#11295)
# Introduction Due to winter to summer timezone update, it shown that we have some unit tests flakiness due to both mocked and unmocked date.now invokation between app bootstrap and test bootstrap This PR does not refactor this behavior Just fix the currently failing test ## Note Removed a duplicated file
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
import { findAvailableTimeZoneOption } from '@/localization/utils/findAvailableTimeZoneOption';
|
||||
jest.useFakeTimers().setSystemTime(new Date('2024-01-01T00:00:00.000Z'));
|
||||
|
||||
// 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+01:00) Central European Standard Time - Paris';
|
||||
const label = '(GMT+02:00) Central European Summer Time - Paris';
|
||||
|
||||
const option = findAvailableTimeZoneOption(ianaTimeZone);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user