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

Add test for duration being active when opening from table

Oliver Günthere20aa60baa33
diff --git a/spec/features/work_packages/table/duration_field_spec.rb b/spec/features/work_packages/table/duration_field_spec.rb
index 2676fc18a74..bc74e137f78 100644
--- a/spec/features/work_packages/table/duration_field_spec.rb
+++ b/spec/features/work_packages/table/duration_field_spec.rb
@@ -25,6 +25,7 @@ describe 'Duration field in the work package table',
end
let(:duration) { wp_table.edit_field work_package, :duration }
+ let(:date_field) { wp_table.edit_field work_package, :startDate }
before do
login_as(current_user)
@@ -33,7 +34,11 @@ describe 'Duration field in the work package table',
wp_table.expect_work_package_listed work_package
end
- it 'shows the duration as days' do
+ it 'shows the duration as days and opens the datepicker on click' do
duration.expect_state_text '4 days'
+ duration.activate!
+
+ date_field.expect_duration_highlighted
+ date_field.expect_duration 4
end
end
diff --git a/spec/support/edit_fields/date_edit_field.rb b/spec/support/edit_fields/date_edit_field.rb
index c5d5136ee7f..56f1a3f3386 100644
--- a/spec/support/edit_fields/date_edit_field.rb
+++ b/spec/support/edit_fields/date_edit_field.rb
@@ -24,6 +24,7 @@ class DateEditField < EditField
:focus_due_date,
:expect_start_highlighted,
:expect_due_highlighted,
+ :expect_duration_highlighted,
:expect_duration,
:set_duration,
:ignore_non_working_days, to: :datepicker