Add scenario 16

pull/11151/head
Oliver Günther 2 years ago
parent afffa030c8
commit 931122eb09
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 1
      frontend/src/app/spot/components/toggle/toggle.component.html
  2. 25
      spec/features/work_packages/datepicker/datepicker_logic_spec.rb
  3. 22
      spec/support/components/datepicker/work_package_datepicker.rb

@ -2,6 +2,7 @@
*ngFor="let option of options"
[ngClass]="{ 'button': true, 'form--field-inline-button': true, '-active': value === option.value }"
data-qa-selector="spot-toggle--option"
[attr.data-qa-active-toggle]="value === option.value"
>
<input
class="spot-toggle--option-input"

@ -381,4 +381,29 @@ describe 'Datepicker modal logic test cases (WP #43539)',
datepicker.expect_duration 4
end
end
describe 'when all values set and include NWD true, changing include NWD to false (Scenario 16)' do
let(:current_attributes) do
{
start_date: Date.parse('2021-02-11'),
due_date: Date.parse('2021-02-14'),
duration: 4,
ignore_non_working_days: true
}
end
it 'sets the finish date to 16th' do
datepicker.expect_start_date '2021-02-11'
datepicker.expect_due_date '2021-02-14'
datepicker.expect_duration 4
datepicker.expect_ignore_non_working_days true
datepicker.ignore_non_working_days false
datepicker.expect_ignore_non_working_days false
datepicker.expect_start_date '2021-02-11'
datepicker.expect_due_date '2021-02-16'
datepicker.expect_duration 4
end
end
end

@ -89,19 +89,29 @@ module Components
start_date_field.click
end
def expect_ignore_non_working_days(val)
text = ignore_non_working_days_option(val)
container
.find('[data-qa-selector="spot-toggle--option"][data-qa-active-toggle]', text: text)
end
def ignore_non_working_days(val)
text =
if val
'Include non-working days'
else
'Working days only'
end
text = ignore_non_working_days_option(val)
container
.find('[data-qa-selector="spot-toggle--option"]', text: text)
.click
end
def ignore_non_working_days_option(val)
if val
'Include non-working days'
else
'Working days only'
end
end
def clear_duration
duration = find_field 'duration'
duration.click

Loading…
Cancel
Save