Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix milestone spec

Benjamin Bädorfc24ce49382fb
diff --git a/spec/support/components/datepicker/work_package_datepicker.rb b/spec/support/components/datepicker/work_package_datepicker.rb
index 8f07313cfaa..6481d76a34a 100644
--- a/spec/support/components/datepicker/work_package_datepicker.rb
+++ b/spec/support/components/datepicker/work_package_datepicker.rb
@@ -16,13 +16,14 @@ module Components
month = Date::MONTHNAMES.index(month) if month.is_a?(String)
retry_block do
# This is for a double-month datepicker
- current_month = Date::MONTHNAMES.index(flatpickr_container.first('.cur-month').text)
- if current_month == nil
+ current_month_element = flatpickr_container.first('.cur-month', between: 0..1)
+ if current_month_element != nil
+ current_month = Date::MONTHNAMES.index(current_month_element.text)
+ else
# This is for a single-month datepicker
current_month = flatpickr_container.first('.flatpickr-monthDropdown-months').value.to_i + 1
end
-
if current_month < month
while current_month < month
flatpickr_container.find('.flatpickr-next-month').click