diff --git a/apps/pwa/e2e/timezone-verify.spec.ts b/apps/pwa/e2e/timezone-verify.spec.ts index cbbfbe5..ff38615 100644 --- a/apps/pwa/e2e/timezone-verify.spec.ts +++ b/apps/pwa/e2e/timezone-verify.spec.ts @@ -4,8 +4,9 @@ * Verifies the admin Timezone section with the real 18-02 API endpoints. * Runs on desktop profile only (admin UI is desktop-focused). * - * NOTE: the IANA picker input is type="text" with list="iana-zones" which gives - * it the ARIA combobox role (not textbox) in Chromium. + * NOTE: the IANA picker is a native is combobox + test('Timezone picker (combobox) is visible and pre-filled', async ({ page }) => { + // Native . A native select shows the full list on tap with no typing — + // and renders as the native wheel picker on iOS — unlike a datalist, which hides + // the list behind whatever text is already in the field. + const zonesByRegion = ianaZones.reduce>((acc, tz) => { + const region = tz.includes('/') ? tz.slice(0, tz.indexOf('/')) : 'Other'; + (acc[region] ??= []).push(tz); + return acc; + }, {}); + const regionOrder = Object.keys(zonesByRegion).sort((a, b) => + a === 'Other' ? 1 : b === 'Other' ? -1 : a.localeCompare(b), + ); + // Defensive: a stored/validated zone could (rarely) be absent from supportedValuesOf. + const currentZoneMissing = + !!effectiveTimezoneInput && !ianaZones.includes(effectiveTimezoneInput); + // Save shared calendar mutation const sharedCalMutation = useMutation({ mutationFn: (calId: number) => setSharedCalendar(calId), @@ -382,14 +398,13 @@ export function AdminPage() { )} - {/* Searchable IANA picker */} + {/* IANA picker — native setTimezoneInput(e.target.value)} - placeholder="e.g. America/Chicago" aria-label="Household timezone" style={{ width: '100%', @@ -402,13 +417,22 @@ export function AdminPage() { color: 'var(--color-text-primary)', background: 'var(--color-surface, #ffffff)', minHeight: '44px', + cursor: 'pointer', }} - /> - - {ianaZones.map((tz) => ( - + )} + {regionOrder.map((region) => ( + + {zonesByRegion[region].map((tz) => ( + + ))} + ))} - + {/* Use detected zone affordance (D-02) */}