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

Christophe Bliardb2c7206e0bd0
diff --git a/spec/features/projects/template_spec.rb b/spec/features/projects/template_spec.rb
index 9a22eb06db0..1f60542acbf 100644
--- a/spec/features/projects/template_spec.rb
+++ b/spec/features/projects/template_spec.rb
@@ -86,7 +86,8 @@ describe 'Project templates', type: :feature, js: true do
login_as current_user
end
- it 'can instantiate the project with the copy permission' do
+ it 'can instantiate the project with the copy permission',
+ with_flag: { work_packages_duration_field_active: true } do
visit new_project_path
name_field.set_value 'Foo bar'
diff --git a/spec/features/work_packages/details/date_editor_spec.rb b/spec/features/work_packages/details/date_editor_spec.rb
index b5c2093afe1..15d7621f931 100644
--- a/spec/features/work_packages/details/date_editor_spec.rb
+++ b/spec/features/work_packages/details/date_editor_spec.rb
@@ -37,7 +37,7 @@ describe 'date inplace editor',
with_settings: { date_format: '%Y-%m-%d' },
js: true, selenium: true do
let(:project) { create :project_with_types, public: true }
- let(:work_package) { create :work_package, project:, start_date: Date.parse('2016-01-02') }
+ let(:work_package) { create :work_package, project:, start_date: Date.parse('2016-01-02'), duration: nil }
let(:user) { create :admin }
let(:work_packages_page) { Pages::FullWorkPackage.new(work_package, project) }
let(:wp_table) { Pages::WorkPackagesTable.new(project) }
@@ -163,7 +163,7 @@ describe 'date inplace editor',
end
context 'with the start date empty' do
- let(:work_package) { create :work_package, project:, start_date: nil }
+ let(:work_package) { create :work_package, project:, start_date: nil, duration: nil }
it 'can set "today" as a date via the provided link' do
start_date.activate!
diff --git a/spec/support/components/datepicker/datepicker.rb b/spec/support/components/datepicker/datepicker.rb
index 371cbe8f3ba..48d5fdf80e3 100644
--- a/spec/support/components/datepicker/datepicker.rb
+++ b/spec/support/components/datepicker/datepicker.rb
@@ -56,11 +56,13 @@ module Components
raise ArgumentError, "Invalid value #{value} for day, expected 1-31"
end
- container
- .first('.flatpickr-days .flatpickr-day:not(.nextMonthDay):not(.prevMonthDay)',
- text: value,
- exact_text: true)
- .click
+ retry_block do
+ container
+ .first('.flatpickr-days .flatpickr-day:not(.nextMonthDay):not(.prevMonthDay)',
+ text: value,
+ exact_text: true)
+ .click
+ end
end
##