File tree 1 file changed +5
-4
lines changed
packages/components/src/calendar/test 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -738,13 +738,14 @@ describe( 'DateCalendar', () => {
738
738
} ) ;
739
739
740
740
it ( 'should handle timezoned dates and convert them to the calendar timezone' , async ( ) => {
741
+ // Still the same time from UTC's POV, just expressed in Tokyo time.
741
742
const tomorrowAtMidnightInTokyo = new TZDate ( tomorrow , 'Asia/Tokyo' ) ;
742
743
743
- render ( < DateCalendar defaultSelected = { tomorrowAtMidnightInTokyo } /> ) ;
744
+ render ( < DateCalendar defaultSelected = { tomorrowAtMidnightInTokyo } timeZone = "-02:00" /> ) ;
744
745
745
- // Tomorrow at midnight in Tokyo is today
746
- // for the calendar (set to UTC by default);
747
- expect ( getDateButton ( today ) ) . toHaveAccessibleName ( / t o d a y / i ) ;
746
+ // Changing the calendar timezone to UTC-2 makes the dates become
747
+ // earlier by 1 day (from midnight to 10pm the previous day).
748
+ expect ( getDateCell ( today , { selected : true } ) ) . toBeVisible ( ) ;
748
749
} ) ;
749
750
} ) ;
750
751
} ) ;
You can’t perform that action at this time.
0 commit comments