@@ -579,47 +579,30 @@ it("should not close popover when closeOnDateSelect is false", async () => {
579579
580580describe ( "date picker - 24-hour format with locales" , ( ) => {
581581 it ( "should allow typing hours 0-23 with non en-US locales that use 24-hour format" , async ( ) => {
582- if ( navigator . userAgent . includes ( "WebKit" ) ) {
583- expect ( true ) ;
584- return ;
585- }
586-
587- setup ( {
582+ const t = setup ( {
588583 granularity : "minute" ,
589- locale : "de-DE " , // german uses 24-hour format
584+ locale : "nl-NL " , // dutch uses 24-hour format
590585 } ) ;
591586
592- const { getHour } = getTimeSegments ( page . getByTestId ) ;
593- const hour = getHour ( ) ;
594-
595- // should not have dayPeriod for 24-hour locales
596- await expectNotExists ( page . getByTestId ( "dayPeriod" ) ) ;
597-
598- // test typing single digit hours > 2 (issue: these get clamped to 12-hour format)
599- await hour . click ( ) ;
600- await userEvent . keyboard ( "3" ) ;
601- await expect . element ( hour ) . toHaveTextContent ( "03" ) ;
602-
603- // test typing hours 13-23 (issue: these should work but currently clamp)
604- await hour . click ( ) ;
605- await userEvent . keyboard ( "15" ) ;
606- await expect . element ( hour ) . toHaveTextContent ( "15" ) ;
607-
608- await hour . click ( ) ;
609- await userEvent . keyboard ( "23" ) ;
610- await expect . element ( hour ) . toHaveTextContent ( "23" ) ;
611-
612- await hour . click ( ) ;
613- await userEvent . keyboard ( "18" ) ;
614- await expect . element ( hour ) . toHaveTextContent ( "18" ) ;
587+ const { getHour, getMinute } = getTimeSegments ( page . getByTestId ) ;
588+
589+ await t . day . click ( ) ;
590+ await userEvent . keyboard ( "9" ) ;
591+
592+ await expect . element ( t . day ) . toHaveTextContent ( "09" ) ;
593+ await expect . element ( t . month ) . toHaveFocus ( ) ;
594+ await userEvent . keyboard ( "9" ) ;
595+ await expect . element ( t . month ) . toHaveTextContent ( "09" ) ;
596+ await expect . element ( t . year ) . toHaveFocus ( ) ;
597+ await userEvent . keyboard ( "1234" ) ;
598+ await expect . element ( t . year ) . toHaveTextContent ( "1234" ) ;
599+ await expect . element ( getHour ( ) ) . toHaveFocus ( ) ;
600+ await userEvent . keyboard ( "22" ) ;
601+ await expect . element ( getHour ( ) ) . toHaveTextContent ( "22" ) ;
602+ await expect . element ( getMinute ( ) ) . toHaveFocus ( ) ;
615603 } ) ;
616604
617605 it ( "should allow arrow key navigation through full 0-23 range with 24-hour locales" , async ( ) => {
618- if ( navigator . userAgent . includes ( "WebKit" ) ) {
619- expect ( true ) ;
620- return ;
621- }
622-
623606 const value = new CalendarDateTime ( 2023 , 10 , 12 , 14 , 30 , 30 , 0 ) ;
624607 setup ( {
625608 value,
@@ -653,11 +636,6 @@ describe("date picker - 24-hour format with locales", () => {
653636 } ) ;
654637
655638 it ( "should display and allow typing hours > 12 with sv-SE locale (24-hour format)" , async ( ) => {
656- if ( navigator . userAgent . includes ( "WebKit" ) ) {
657- expect ( true ) ;
658- return ;
659- }
660-
661639 const value = new CalendarDateTime ( 2023 , 10 , 12 , 18 , 30 , 30 , 0 ) ;
662640 setup ( {
663641 value,
@@ -686,11 +664,6 @@ describe("date picker - 24-hour format with locales", () => {
686664 } ) ;
687665
688666 it ( "should handle ja-JP locale (24-hour format) correctly" , async ( ) => {
689- if ( navigator . userAgent . includes ( "WebKit" ) ) {
690- expect ( true ) ;
691- return ;
692- }
693-
694667 const value = new CalendarDateTime ( 2023 , 10 , 12 , 16 , 30 , 0 , 0 ) ;
695668 setup ( {
696669 value,
0 commit comments