mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Fix flickering test (date-related)
The test wants to change a date using the datepicker from year 2025 to year 2024. Using `fill_in` or `set` on the year input of the date picker does not trigger any event which would update the internal state of the flatpickr (it can be seen because the calendar dates is not redrawn). So when the month is changed, the year switches back to 2025 (the internal state), the wrong date is picked and the test fails. This is fixed by sending a right arrow key to the year input to trigger a keyboard event which then updates the internal state of the flatpickr. This is a flickering test as the issue only occurs when the year needs to be changed.
This commit is contained in:
@@ -57,7 +57,8 @@ module Components
|
||||
retry_block do
|
||||
flatpickr_container
|
||||
.first(".numInput.cur-year")
|
||||
.set value
|
||||
.fill_in(with: value)
|
||||
.send_keys :right # to trigger a keyboard event to get the internal state of flatpickr updated
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user