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 tests broken in previous commit

Christophe Bliard50dbd4e881b0
diff --git a/spec/features/admin/working_days_spec.rb b/spec/features/admin/working_days_spec.rb
index c87110ffcee..dc49660bf8b 100644
--- a/spec/features/admin/working_days_spec.rb
+++ b/spec/features/admin/working_days_spec.rb
@@ -191,6 +191,7 @@ RSpec.describe "Working Days", :js, :with_cuprite do
# Check if a date is correctly highlighted after selecting it in different time zones
datepicker.select_day 5
+ expect(datepicker).to have_day_selected("5")
# It can cancel and reopen
within_test_selector("op-datepicker-modal") do
diff --git a/spec/support/components/datepicker/datepicker.rb b/spec/support/components/datepicker/datepicker.rb
index 9fc2c1c5413..96de5d5d1a9 100644
--- a/spec/support/components/datepicker/datepicker.rb
+++ b/spec/support/components/datepicker/datepicker.rb
@@ -85,11 +85,6 @@ module Components
.first(".flatpickr-days .flatpickr-day:not(.nextMonthDay):not(.prevMonthDay)",
text: value)
.click
-
- # safeguard
- unless flatpickr_container.has_css?(".flatpickr-day.selected", text: value, wait: 1)
- raise "Expected #{value} to be selected"
- end
end
end
diff --git a/spec/support/components/datepicker/datepicker_modal.rb b/spec/support/components/datepicker/datepicker_modal.rb
index 8d20e10ea40..fbbb9daed8a 100644
--- a/spec/support/components/datepicker/datepicker_modal.rb
+++ b/spec/support/components/datepicker/datepicker_modal.rb
@@ -12,5 +12,9 @@ module Components
raise "Expected date to equal #{date}, but got #{input.value}" unless input.value == date.iso8601
end
end
+
+ def has_day_selected?(value)
+ flatpickr_container.has_css?(".flatpickr-day.selected", text: value, wait: 1)
+ end
end
end