From 8c1b77701aef982bc42d4fca75acab964e1f3c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 30 Jan 2025 09:47:21 +0100 Subject: [PATCH] Change: Update list of possible timezones 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 --- src/web/pages/schedules/__tests__/dialog.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/web/pages/schedules/__tests__/dialog.jsx b/src/web/pages/schedules/__tests__/dialog.jsx index 6850a1ee19..153e93d7d6 100644 --- a/src/web/pages/schedules/__tests__/dialog.jsx +++ b/src/web/pages/schedules/__tests__/dialog.jsx @@ -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, @@ -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', @@ -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);