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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Implement scenarios 22 and 23
Oliver Güntherb94dca74f950
diff --git a/spec/features/work_packages/datepicker/datepicker_logic_spec.rb b/spec/features/work_packages/datepicker/datepicker_logic_spec.rbindex 71b19a7d050..5fff58b4ee2 100644--- a/spec/features/work_packages/datepicker/datepicker_logic_spec.rb+++ b/spec/features/work_packages/datepicker/datepicker_logic_spec.rb@@ -714,7 +714,7 @@ describe 'Datepicker modal logic test cases (WP #43539)',endend- describe 'When all values set, clear the due date (Scenario 21a)' do+ describe 'When all values set, clear the due date (Scenario 21b)' dolet(:current_attributes) do{start_date: Date.parse('2021-02-20'),@@ -741,6 +741,142 @@ describe 'Datepicker modal logic test cases (WP #43539)',endend+ describe 'When only start date set, duration in focus, select earlier date (Scenario 22a)' do+ let(:current_attributes) do+ {+ start_date: Date.parse('2021-02-18'),+ due_date: nil,+ duration: nil,+ ignore_non_working_days: true+ }+ end++ it 'sets start date to selected value, finish date to start date' do+ datepicker.expect_start_date '2021-02-18'+ datepicker.expect_due_date ''+ datepicker.expect_duration ''++ datepicker.focus_duration+ datepicker.expect_duration_highlighted++ sleep 1++ datepicker.select_day 17+ datepicker.expect_start_date '2021-02-17'+ datepicker.expect_due_date '2021-02-18'+ datepicker.expect_duration 2++ datepicker.expect_start_highlighted++ apply_and_expect_saved duration: 2,+ start_date: Date.parse('2021-02-17'),+ due_date: Date.parse('2021-02-18'),+ ignore_non_working_days: true+ end+ end++ describe 'When only start date set, duration in focus, select later date (Scenario 22b)' do+ let(:current_attributes) do+ {+ start_date: Date.parse('2021-02-18'),+ due_date: nil,+ duration: nil,+ ignore_non_working_days: true+ }+ end++ it 'sets finish date to selected date' do+ datepicker.expect_start_date '2021-02-18'+ datepicker.expect_due_date ''+ datepicker.expect_duration ''++ datepicker.focus_duration+ datepicker.expect_duration_highlighted++ sleep 1++ datepicker.select_day 19+ datepicker.expect_start_date '2021-02-18'+ datepicker.expect_due_date '2021-02-19'+ datepicker.expect_duration 2++ datepicker.expect_start_highlighted++ apply_and_expect_saved duration: 2,+ start_date: Date.parse('2021-02-18'),+ due_date: Date.parse('2021-02-19'),+ ignore_non_working_days: true+ end+ end++ describe 'When only due date set, duration in focus, select later date (Scenario 23a)' do+ let(:current_attributes) do+ {+ start_date: nil,+ due_date: Date.parse('2021-02-18'),+ duration: nil,+ ignore_non_working_days: true+ }+ end++ it 'sets due date to selected value, start to finish date, focus on finish' do+ datepicker.expect_start_date ''+ datepicker.expect_due_date '2021-02-18'+ datepicker.expect_duration ''++ datepicker.focus_duration+ datepicker.expect_duration_highlighted++ sleep 1++ datepicker.select_day 19+ datepicker.expect_start_date '2021-02-18'+ datepicker.expect_due_date '2021-02-19'+ datepicker.expect_duration 2++ datepicker.expect_due_highlighted++ apply_and_expect_saved duration: 2,+ start_date: Date.parse('2021-02-18'),+ due_date: Date.parse('2021-02-19'),+ ignore_non_working_days: true+ end+ end++ describe 'When only due date set, duration in focus, select earlier date (Scenario 23b)' do+ let(:current_attributes) do+ {+ start_date: nil,+ due_date: Date.parse('2021-02-18'),+ duration: nil,+ ignore_non_working_days: true+ }+ end++ it 'sets finish date to selected date' do+ datepicker.expect_start_date ''+ datepicker.expect_due_date '2021-02-18'+ datepicker.expect_duration ''++ datepicker.focus_duration+ datepicker.expect_duration_highlighted++ sleep 1++ datepicker.select_day 17+ datepicker.expect_start_date '2021-02-17'+ datepicker.expect_due_date '2021-02-18'+ datepicker.expect_duration 2++ datepicker.expect_due_highlighted++ apply_and_expect_saved duration: 2,+ start_date: Date.parse('2021-02-17'),+ due_date: Date.parse('2021-02-18'),+ ignore_non_working_days: true+ end+ end+describe 'when all values set and duration highlighted, selecting date in datepicker' dolet(:current_attributes) do{diff --git a/spec/support/components/datepicker/work_package_datepicker.rb b/spec/support/components/datepicker/work_package_datepicker.rbindex 65d0d87255d..480536e1bea 100644--- a/spec/support/components/datepicker/work_package_datepicker.rb+++ b/spec/support/components/datepicker/work_package_datepicker.rb@@ -132,7 +132,7 @@ module Componentsenddef focus_duration- due_date_field.click+ duration_field.clickenddef set_today(date)