The following test fails when the defaultValue timeZone's daylight savings/standard time does not match the current timeZone's standard/daylight savings time.
If the defaultValue is on daylight savings time and the user clears the value while in a time zone on standard time, the DatePicker's time zone will change to standard time. I think this is the correct behavior, however, the test is written to always expect "PDT" Pacific Daylight Savings Time, which means it will fail when we're on standard time.
π― Current Behavior
The test is written to always expect "PDT" Pacific Daylight Savings Time, which means it will fail when we're on standard time.
Provide a general summary of the issue here
The following test fails when the
defaultValue
timeZone's daylight savings/standard time does not match the current timeZone's standard/daylight savings time.https://github.com/adobe/react-spectrum/blob/f33288c867e305341b63b4ec88e55bc566ae115e/packages/%40react-spectrum/datepicker/test/DatePicker.test.js#L1897-L1932
π€ Expected Behavior?
If the
defaultValue
is on daylight savings time and the user clears the value while in a time zone on standard time, the DatePicker's time zone will change to standard time. I think this is the correct behavior, however, the test is written to always expect "PDT" Pacific Daylight Savings Time, which means it will fail when we're on standard time.π― Current Behavior
The test is written to always expect "PDT" Pacific Daylight Savings Time, which means it will fail when we're on standard time.
https://github.com/adobe/react-spectrum/blob/f33288c867e305341b63b4ec88e55bc566ae115e/packages/%40react-spectrum/datepicker/test/DatePicker.test.js#L1931
π Possible Solution
Use the
timeZoneName
for the current date time.π¦ Context
No response
π₯οΈ Steps to Reproduce
Run
yarn test packages/@react-spectrum/datepicker/test/DatePicker.test.js
from the first Sunday in November to the second Sunday in March.Version
@react-spectrum/datepicker@3.10.3
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
If other, please specify.
No response
What operating system are you using?
MacOS
π§’ Your Company/Team
Adobe/Accessibility
π· Tracking Issue
No response