From f6695495e4a46331e9aeab937378d427a527bb39 Mon Sep 17 00:00:00 2001 From: bsatarnejad Date: Tue, 31 Jan 2023 14:24:34 +0100 Subject: [PATCH] add a test to check if NWDs are correctly highlighted on gantt chart --- .../timeline/container/wp-timeline-container.directive.ts | 2 +- spec/features/work_packages/timeline/timeline_dates_spec.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts b/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts index 5f45d86233..6028c2bfe6 100644 --- a/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts +++ b/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts @@ -150,7 +150,7 @@ export class WorkPackageTimelineTableController extends UntilDestroyedMixin impl const scrollBar = document.querySelector('.work-packages-tabletimeline--timeline-side'); if (scrollBar) { scrollBar.addEventListener('scroll', () => { - this.requireNonWorkingDays(this.getFirstDayInViewport().format('YYYY-MM-DD'), this.getLastDayInViewport().format('YYYY-MM-DD')); + this.requireNonWorkingDays(this.getFirstDayInViewport().format('YYYY-MM-DD'), this.getLastDayInViewport().format('YYYY-MM-DD')); }); } diff --git a/spec/features/work_packages/timeline/timeline_dates_spec.rb b/spec/features/work_packages/timeline/timeline_dates_spec.rb index fe475ec2b8..255d8ed3fb 100644 --- a/spec/features/work_packages/timeline/timeline_dates_spec.rb +++ b/spec/features/work_packages/timeline/timeline_dates_spec.rb @@ -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"]')