You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following test fails when the defaultValue timeZone's daylight savings/standard time does not match the current timeZone's standard/daylight savings time.
it('should keep timeZone from defaultValue when date and time are cleared',asyncfunction(){
let{getAllByRole}=render(
<DatePicker
label="Date"
defaultValue={parseZonedDateTime(
'2024-09-21T00:00:00[America/Los_Angeles]'
)}/>
);
letcombobox=getAllByRole('group')[0];
expectPlaceholder(combobox,'9/21/2024, 12:00 AM PDT');
awaituser.tab();
awaituser.keyboard('{Backspace}');
awaituser.tab();
leti;
for(i=0;i<2;i++){
awaituser.keyboard('{Backspace}');
}
awaituser.tab();
for(i=0;i<4;i++){
awaituser.keyboard('{Backspace}');
}
awaituser.tab();
for(i=0;i<2;i++){
awaituser.keyboard('{Backspace}');
}
awaituser.tab();
for(i=0;i<2;i++){
awaituser.keyboard('{Backspace}');
}
awaituser.tab();
awaituser.keyboard('{Backspace}');
expectPlaceholder(combobox,'mm/dd/yyyy, ––:–– AM PDT');
});
🤔 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.
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.
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.
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.
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.
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.react-spectrum/packages/@react-spectrum/datepicker/test/DatePicker.test.js
Lines 1897 to 1932 in f33288c
🤔 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.
react-spectrum/packages/@react-spectrum/datepicker/test/DatePicker.test.js
Line 1931 in f33288c
💁 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
The text was updated successfully, but these errors were encountered: