Add scenario 7

pull/11151/head
Oliver Günther 2 years ago
parent b5bbbc0802
commit a8f94ed67c
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 22
      spec/features/work_packages/datepicker/datepicker_logic_spec.rb
  2. 28
      spec/support/components/datepicker/work_package_datepicker.rb

@ -254,4 +254,26 @@ describe 'Datepicker modal logic test cases (WP #43539)',
datepicker.expect_duration nil
end
end
describe 'when all values set, change start date (test case 7)' do
let(:current_attributes) do
{
start_date: Date.parse('2021-02-08'),
due_date: Date.parse('2021-02-11'),
duration: 4
}
end
it 'adjusts the duration' do
datepicker.expect_start_date '2021-02-08'
datepicker.expect_due_date '2021-02-11'
datepicker.expect_duration 4
datepicker.set_start_date '2021-02-09'
datepicker.expect_start_date '2021-02-09'
datepicker.expect_due_date '2021-02-11'
datepicker.expect_duration 3
end
end
end

@ -57,7 +57,7 @@ module Components
container.find_field 'startDate'
end
def end_date_field
def due_date_field
container.find_field 'endDate'
end
@ -66,9 +66,24 @@ module Components
end
def set_duration(value)
duration = find_field 'duration'
duration.click
duration.set value
duration_field.click
duration_field.set value
# Focus a different field
start_date_field.click
end
def set_start_date(value)
start_date_field.click
start_date_field.set value
# Focus a different field
due_date_field.click
end
def set_due_date(value)
due_date_field.click
due_date_field.set value
# Focus a different field
start_date_field.click
@ -78,8 +93,9 @@ module Components
duration = find_field 'duration'
duration.click
remove_btn = container.find('[data-qa-selector="datepicker-duration"] .spot-text-field--clear-button')
remove_btn.click
container
.find('[data-qa-selector="datepicker-duration"] .spot-text-field--clear-button')
.click
# Focus a different field
start_date_field.click

Loading…
Cancel
Save