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 datepicker spec

Benjamin Bädorf0ca55e813244
diff --git a/spec/support/components/datepicker/work_package_datepicker.rb b/spec/support/components/datepicker/work_package_datepicker.rb
index 83c05419d34..ba59e6141da 100644
--- a/spec/support/components/datepicker/work_package_datepicker.rb
+++ b/spec/support/components/datepicker/work_package_datepicker.rb
@@ -15,17 +15,17 @@ module Components
def select_month(month)
month = Date::MONTHNAMES.index(month) if month.is_a?(String)
retry_block do
- current_month = Date::MONTHNAMES.index(flatpickr_container.first('.cur-month').text)
+ current_month = flatpickr_container.first('.flatpickr-monthDropdown-months').value.to_i + 1
if current_month < month
while current_month < month
flatpickr_container.find('.flatpickr-next-month').click
- current_month = Date::MONTHNAMES.index(flatpickr_container.first('.cur-month').text)
+ current_month = flatpickr_container.first('.flatpickr-monthDropdown-months').value.to_i + 1
end
elsif current_month > month
while current_month > month
flatpickr_container.find('.flatpickr-prev-month').click
- current_month = Date::MONTHNAMES.index(flatpickr_container.first('.cur-month').text)
+ current_month = flatpickr_container.first('.flatpickr-monthDropdown-months').value.to_i + 1
end
end
end