|
|
|
@ -125,14 +125,18 @@ RSpec.describe 'Work package timeline date formatting', |
|
|
|
|
let(:current_user) { create :admin, language: 'en' } |
|
|
|
|
|
|
|
|
|
shared_let(:week_days) { week_with_saturday_and_sunday_as_weekend } |
|
|
|
|
shared_let(:non_working_day) do |
|
|
|
|
create(:non_working_day, |
|
|
|
|
date: '28-12-2020') |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'shows them as disabled' do |
|
|
|
|
expect_date_week work_package.start_date.iso8601, '01' |
|
|
|
|
|
|
|
|
|
expect(page).to have_selector('[data-qa-selector="wp-timeline--non-working-day_27-12-2020"]') |
|
|
|
|
expect(page).to have_selector('[data-qa-selector="wp-timeline--non-working-day_2-1-2021"]') |
|
|
|
|
expect(page).to have_selector('[data-qa-selector="wp-timeline--non-working-day_28-12-2020"]') |
|
|
|
|
|
|
|
|
|
expect(page).to have_no_selector('[data-qa-selector="wp-timeline--non-working-day_28-12-2020"]') |
|
|
|
|
expect(page).to have_no_selector('[data-qa-selector="wp-timeline--non-working-day_29-12-2020"]') |
|
|
|
|
expect(page).to have_no_selector('[data-qa-selector="wp-timeline--non-working-day_30-12-2020"]') |
|
|
|
|
expect(page).to have_no_selector('[data-qa-selector="wp-timeline--non-working-day_31-12-2020"]') |
|
|
|
@ -171,6 +175,11 @@ RSpec.describe 'Work package timeline date formatting', |
|
|
|
|
let(:current_user) { create :admin } |
|
|
|
|
let(:row) { wp_timeline.timeline_row work_package_with_non_working_days.id } |
|
|
|
|
|
|
|
|
|
shared_let(:non_working_day) do |
|
|
|
|
create(:non_working_day, |
|
|
|
|
date: '06-01-2021') |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
shared_examples "sets dates, duration and displays bar" do |
|
|
|
|
it 'sets dates, duration and duration bar' do |
|
|
|
|
subject |
|
|
|
@ -224,7 +233,7 @@ RSpec.describe 'Work package timeline date formatting', |
|
|
|
|
let(:expected_bar_duration) { work_package_with_non_working_days.duration } |
|
|
|
|
let(:expected_start_date) { Date.parse('2021-01-04') } |
|
|
|
|
let(:expected_due_date) { Date.parse('2021-01-08') } |
|
|
|
|
let(:expected_duration) { 5 } |
|
|
|
|
let(:expected_duration) { 4 } |
|
|
|
|
let(:expected_label) { work_package_with_non_working_days.subject } |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
@ -237,7 +246,7 @@ RSpec.describe 'Work package timeline date formatting', |
|
|
|
|
let(:expected_bar_duration) { work_package_with_non_working_days.duration + 2 } |
|
|
|
|
let(:expected_start_date) { Date.parse('2021-01-05') } |
|
|
|
|
let(:expected_due_date) { Date.parse('2021-01-11') } |
|
|
|
|
let(:expected_duration) { 5 } |
|
|
|
|
let(:expected_duration) { 4 } |
|
|
|
|
let(:expected_label) { work_package_with_non_working_days.subject } |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
@ -250,7 +259,7 @@ RSpec.describe 'Work package timeline date formatting', |
|
|
|
|
let(:expected_bar_duration) { work_package_with_non_working_days.duration } |
|
|
|
|
let(:expected_start_date) { Date.parse('2021-01-04') } |
|
|
|
|
let(:expected_due_date) { Date.parse('2021-01-08') } |
|
|
|
|
let(:expected_duration) { 5 } |
|
|
|
|
let(:expected_duration) { 4 } |
|
|
|
|
let(:expected_label) { work_package_with_non_working_days.subject } |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
@ -263,7 +272,7 @@ RSpec.describe 'Work package timeline date formatting', |
|
|
|
|
let(:expected_bar_duration) { work_package_with_non_working_days.duration + 2 } |
|
|
|
|
let(:expected_start_date) { Date.parse('2021-01-05') } |
|
|
|
|
let(:expected_due_date) { Date.parse('2021-01-11') } |
|
|
|
|
let(:expected_duration) { 5 } |
|
|
|
|
let(:expected_duration) { 4 } |
|
|
|
|
let(:expected_label) { work_package_with_non_working_days.subject } |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
@ -276,7 +285,7 @@ RSpec.describe 'Work package timeline date formatting', |
|
|
|
|
let(:expected_bar_duration) { work_package_with_non_working_days.duration + 3 } |
|
|
|
|
let(:expected_start_date) { Date.parse('2021-01-05') } |
|
|
|
|
let(:expected_due_date) { Date.parse('2021-01-12') } |
|
|
|
|
let(:expected_duration) { 6 } |
|
|
|
|
let(:expected_duration) { 5 } |
|
|
|
|
let(:expected_label) { work_package_with_non_working_days.subject } |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|