Commit 5bd9b194 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'afontaine/add-timezone-assertion-after-pg-12' into 'master'

Add Assert that Timezone is Formatted Properly

See merge request gitlab-org/gitlab!61374
parents 252ec0e5 a4e13d6f
...@@ -7,7 +7,7 @@ const formatTimezoneName = (freezePeriod, timezoneList) => ...@@ -7,7 +7,7 @@ const formatTimezoneName = (freezePeriod, timezoneList) =>
cron_timezone: { cron_timezone: {
formattedTimezone: timezoneList.find((tz) => tz.identifier === freezePeriod.cron_timezone) formattedTimezone: timezoneList.find((tz) => tz.identifier === freezePeriod.cron_timezone)
?.name, ?.name,
identifier: freezePeriod.cronTimezone, identifier: freezePeriod.cron_timezone,
}, },
}); });
......
...@@ -27,15 +27,19 @@ describe('Deploy freeze mutations', () => { ...@@ -27,15 +27,19 @@ describe('Deploy freeze mutations', () => {
describe('RECEIVE_FREEZE_PERIODS_SUCCESS', () => { describe('RECEIVE_FREEZE_PERIODS_SUCCESS', () => {
it('should set freeze periods and format timezones from identifiers to names', () => { it('should set freeze periods and format timezones from identifiers to names', () => {
const timezoneNames = ['Eastern Time (US & Canada)', 'UTC', 'Berlin']; const timezoneNames = {
'Europe/Berlin': 'Berlin',
'Etc/UTC': 'UTC',
'America/New_York': 'Eastern Time (US & Canada)',
};
mutations[types.RECEIVE_FREEZE_PERIODS_SUCCESS](stateCopy, freezePeriodsFixture); mutations[types.RECEIVE_FREEZE_PERIODS_SUCCESS](stateCopy, freezePeriodsFixture);
const expectedFreezePeriods = freezePeriodsFixture.map((freezePeriod, index) => ({ const expectedFreezePeriods = freezePeriodsFixture.map((freezePeriod) => ({
...convertObjectPropsToCamelCase(freezePeriod), ...convertObjectPropsToCamelCase(freezePeriod),
cronTimezone: { cronTimezone: {
formattedTimezone: timezoneNames[index], formattedTimezone: timezoneNames[freezePeriod.cron_timezone],
identifier: freezePeriod.cronTimezone, identifier: freezePeriod.cron_timezone,
}, },
})); }));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment