@@ -139,7 +139,7 @@ describeControlUiE2e("Control UI cron mocked Gateway E2E", () => {
139139 await server ?. close ( ) ;
140140 } ) ;
141141
142- it ( "suggests Asia/Shanghai in the rendered cron timezone selector " , async ( ) => {
142+ it ( "suggests browser-supported timezones without restricting free-form input " , async ( ) => {
143143 const context = await browser . newContext ( {
144144 locale : "en-US" ,
145145 serviceWorkers : "block" ,
@@ -163,11 +163,18 @@ describeControlUiE2e("Control UI cron mocked Gateway E2E", () => {
163163 const timezone = page . locator ( "#cron-cron-tz" ) ;
164164 await timezone . waitFor ( { state : "visible" } ) ;
165165 expect ( await timezone . getAttribute ( "list" ) ) . toBe ( "cron-tz-suggestions" ) ;
166- expect (
167- await page
168- . locator ( "#cron-tz-suggestions option" )
169- . evaluateAll ( ( options ) => options . map ( ( option ) => option . getAttribute ( "value" ) ) ) ,
170- ) . toContain ( "Asia/Shanghai" ) ;
166+ const browserTimezone = await page . evaluate (
167+ ( ) => Intl . DateTimeFormat ( ) . resolvedOptions ( ) . timeZone ,
168+ ) ;
169+ const timezoneOptions = await page
170+ . locator ( "#cron-tz-suggestions option" )
171+ . evaluateAll ( ( options ) => options . map ( ( option ) => option . getAttribute ( "value" ) ) ) ;
172+ expect ( timezoneOptions ) . toContain ( browserTimezone ) ;
173+ expect ( timezoneOptions ) . toContain ( "UTC" ) ;
174+ expect ( timezoneOptions . length ) . toBeGreaterThan ( 100 ) ;
175+
176+ await timezone . fill ( "Etc/GMT+3" ) ;
177+ expect ( await timezone . inputValue ( ) ) . toBe ( "Etc/GMT+3" ) ;
171178 } finally {
172179 await context . close ( ) ;
173180 }
0 commit comments