Skip to content

Commit

Permalink
Change: Update list of possible timezones
Browse files Browse the repository at this point in the history
Our list of timezone was added 8 years ago and got no update since then.
To have a more complete list of possible timezone and keep the list up
to date, use the list of timezones from `moment.js` instead.

The UTC timezone is just named UTC now instead of using the label
`Coordinated Universal Time/UTC`. Also the UTC timezone is sorted
alphabetically into the list and isn't shown at the top anymore.

Fixes #4308
  • Loading branch information
bjoernricks committed Jan 30, 2025
1 parent ab44b78 commit 8c1b777
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/web/pages/schedules/__tests__/dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import {describe, test, expect, testing} from '@gsa/testing';
import Schedule from 'gmp/models/schedule';
import timezones from 'gmp/timezones';
import {
changeInputValue,
clickElement,
Expand Down Expand Up @@ -108,7 +109,7 @@ describe('ScheduleDialog component tests', () => {
expect(inputs[1]).toHaveValue('hello world'); // comment field

const defaultTimezone = selects[0];
expect(defaultTimezone).toHaveValue('Coordinated Universal Time/UTC');
expect(defaultTimezone).toHaveValue('UTC');

checkElementVisibilityAndContent(
'Start Date',
Expand Down Expand Up @@ -190,13 +191,13 @@ describe('ScheduleDialog component tests', () => {

let selectItems;
const selects = queryAllSelectElements();
expect(selects[0]).toHaveValue('Coordinated Universal Time/UTC');
expect(selects[0]).toHaveValue('UTC');
expect(selects[1]).toHaveValue('Weekly');

selectItems = await getSelectItemElementsForSelect(selects[0]);
expect(selectItems.length).toBe(422);
expect(selectItems.length).toBe(timezones.length);
await clickElement(selectItems[1]);
expect(selects[0]).toHaveValue('Africa/Abidjan');
expect(selects[0]).toHaveValue(timezones[1]);

selectItems = await getSelectItemElementsForSelect(selects[1]);
expect(selectItems.length).toBe(8);
Expand Down

0 comments on commit 8c1b777

Please sign in to comment.