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
Describe the bug
When I was working on one of the other bugs in this repo, I accidentally found this issue with the existing test cases. The issue we're having is with the test module datepicker_test.test.js. There currently 2 test blocks are having an issue as I mentioned in the attached screenshot
DatePicker › should be possible to preSelect minDate (no maxDate set)
DatePicker › should be possible to preSelect minDate (maxDate set)
To Reproduce
Just execute yarn testat the end of the month (like today) or update the selected date and the minDate to the last date of a month and we'll get this issue.
Why this Bug?
I shared one of the failed test cases in the above screenshot. The issue there is we're initially getting a selected day using const selectedDayNode = getSelectedDayNode(data.container) and then doing right and left arrow click over it. This test case will work in most of the days except the last day of a month. Because, let's consider 30th sept, 2024 as the selected date. When the user press right, a new month view will get rendered and then the existing selectedDayNode will not be available to us anymore. But in our code we didn't refetch the selectedDayNode and do Left click on it. So only the left click didn't get fired and the test case failed.
If the selected date is not the end of the month, this test case will work. Because, eventhough the actual selecteDayNode gets changed to the next date on the initial right arrow click, but still the date we stored in selecteDayNode is still accessible to us and left click over it, will inturn handled by the corresponding component and the test case will pass.
The same issue happens in the other mentioned test case
Possible Fixes:
There are 2 ways to fix the issue
Refetch the selectedDayNode after performing the initial right arrow click and perform left click over it
Update the selectedDate and the minDate to some earlier date in a month, so that the right arrow click won't render a new month view
I'll fix the issue like the above mentioned 2nd way.
The text was updated successfully, but these errors were encountered:
Describe the bug
When I was working on one of the other bugs in this repo, I accidentally found this issue with the existing test cases. The issue we're having is with the test module
datepicker_test.test.js
. There currently 2 test blocks are having an issue as I mentioned in the attached screenshotDatePicker › should be possible to preSelect minDate (no maxDate set)
DatePicker › should be possible to preSelect minDate (maxDate set)
To Reproduce
Just execute
yarn test
at the end of the month (like today) or update the selected date and the minDate to the last date of a month and we'll get this issue.Why this Bug?
I shared one of the failed test cases in the above screenshot. The issue there is we're initially getting a selected day using
const selectedDayNode = getSelectedDayNode(data.container)
and then doing right and left arrow click over it. This test case will work in most of the days except the last day of a month. Because, let's consider 30th sept, 2024 as the selected date. When the user press right, a new month view will get rendered and then the existing selectedDayNode will not be available to us anymore. But in our code we didn't refetch the selectedDayNode and do Left click on it. So only the left click didn't get fired and the test case failed.If the selected date is not the end of the month, this test case will work. Because, eventhough the actual selecteDayNode gets changed to the next date on the initial right arrow click, but still the date we stored in selecteDayNode is still accessible to us and left click over it, will inturn handled by the corresponding component and the test case will pass.
The same issue happens in the other mentioned test case
Possible Fixes:
There are 2 ways to fix the issue
I'll fix the issue like the above mentioned 2nd way.
The text was updated successfully, but these errors were encountered: