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
Adapt some more test selectors
Henriette Dargedf642c8ef2e5
diff --git a/app/components/work_packages/date_picker/form_content_component.html.erb b/app/components/work_packages/date_picker/form_content_component.html.erbindex 357c0e59fe6..807f1675eaf 100644--- a/app/components/work_packages/date_picker/form_content_component.html.erb+++ b/app/components/work_packages/date_picker/form_content_component.html.erb@@ -12,16 +12,24 @@first_row.with_column dorender(Primer::Alpha::FormControl.new(label: I18n.t("work_packages.datepicker_modal.mode.title"))) do |component|component.with_input do- render(Primer::Alpha::SegmentedControl.new("aria-label": I18n.t("work_packages.datepicker_modal.mode.title"))) do |control|+ render(Primer::Alpha::SegmentedControl.new("aria-label": I18n.t("work_packages.datepicker_modal.mode.title"), test_selector: "op-datepicker-modal--scheduling",)) do |control|control.with_item(tag: :a,href: work_package_datepicker_dialog_content_path(params.merge(schedule_manually: true).permit!),- data: { turbo_stream: true },+ data: {+ turbo_stream: true,+ qa_selected: schedule_manually+ },+ test_selector: "op-datepicker-modal--scheduling_manual",label: I18n.t("work_packages.datepicker_modal.mode.manual"),title: I18n.t("work_packages.datepicker_modal.mode.manual"),selected: schedule_manually)control.with_item(tag: :a,href: work_package_datepicker_dialog_content_path(params.merge(schedule_manually: false).permit!),- data: { turbo_stream: true },+ data: {+ turbo_stream: true,+ qa_selected: !schedule_manually+ },+ test_selector: "op-datepicker-modal--scheduling_automatic",disabled: work_package.new_record?,label: I18n.t("work_packages.datepicker_modal.mode.automatic"),title: I18n.t("work_packages.datepicker_modal.mode.automatic"),@@ -36,6 +44,7 @@label: I18n.t("work_packages.datepicker_modal.ignore_non_working_days.title"),checked: !work_package.ignore_non_working_days,disabled: disabled_checkbox?,+ test_selector: "op-datepicker-modal--ignore-non-working-days",value: 0,unchecked_value: 1,data: { "work-packages--date-picker--preview-target": "fieldInput",diff --git a/frontend/src/app/shared/components/datepicker/wp-modal-date-picker/wp-modal-date-picker.component.ts b/frontend/src/app/shared/components/datepicker/wp-modal-date-picker/wp-modal-date-picker.component.tsindex 30e90e2b2b5..45de03ba8be 100644--- a/frontend/src/app/shared/components/datepicker/wp-modal-date-picker/wp-modal-date-picker.component.ts+++ b/frontend/src/app/shared/components/datepicker/wp-modal-date-picker/wp-modal-date-picker.component.ts@@ -134,6 +134,8 @@ export class OpWpModalDatePickerComponent extends UntilDestroyedMixin implementsprivate initializeDatepicker() {this.datePickerInstance?.destroy();+ const ignoreNonWorkingDaysTemp = this.ignoreNonWorkingDays;+this.datePickerInstance = new DatePicker(this.injector,'#flatpickr-input',@@ -173,7 +175,7 @@ export class OpWpModalDatePickerComponent extends UntilDestroyedMixin implementsonDayCreate: async (dObj:Date[], dStr:string, fp:flatpickr.Instance, dayElem:DayElement) => {onDayCreate(dayElem,- this.ignoreNonWorkingDays,+ ignoreNonWorkingDaysTemp,await this.datePickerInstance?.isNonWorkingDay(dayElem.dateObj),this.isDayDisabled(dayElem),);diff --git a/spec/features/work_packages/datepicker/datepicker_logic_spec.rb b/spec/features/work_packages/datepicker/datepicker_logic_spec.rbindex f35f44a3c2f..60e667c7405 100644--- a/spec/features/work_packages/datepicker/datepicker_logic_spec.rb+++ b/spec/features/work_packages/datepicker/datepicker_logic_spec.rb@@ -244,7 +244,7 @@ RSpec.describe "Datepicker modal logic test cases (WP #43539)", :js, with_settindatepicker.expect_due_date "2021-02-12"datepicker.expect_duration 3- datepicker.clear_duration_with_icon+ datepicker.clear_durationdatepicker.expect_start_date "2021-02-09"datepicker.expect_due_date ""@@ -266,7 +266,7 @@ RSpec.describe "Datepicker modal logic test cases (WP #43539)", :js, with_settindatepicker.expect_due_date "2021-02-12"datepicker.expect_duration 3- datepicker.clear_duration_with_icon+ datepicker.clear_durationdatepicker.expect_start_date "2021-02-09"datepicker.expect_due_date ""@@ -279,7 +279,7 @@ RSpec.describe "Datepicker modal logic test cases (WP #43539)", :js, with_settindatepicker.expect_due_date "2021-02-09"datepicker.expect_duration 3- datepicker.clear_duration_with_icon+ datepicker.clear_durationdatepicker.expect_start_date "2021-02-05"datepicker.expect_due_date ""diff --git a/spec/support/components/datepicker/work_package_datepicker.rb b/spec/support/components/datepicker/work_package_datepicker.rbindex f04c1596244..f8505847599 100644--- a/spec/support/components/datepicker/work_package_datepicker.rb+++ b/spec/support/components/datepicker/work_package_datepicker.rb@@ -86,7 +86,7 @@ module Componentsenddef expect_due_highlighted- expect(container).to have_css('[data-test-selector="op-datepicker-modal--end-date-field"][data-qa-highlighted]')+ expect(container).to have_css('[data-test-selector="op-datepicker-modal--due-date-field"][data-qa-highlighted]')enddef duration_field@@ -127,34 +127,38 @@ module Componentsenddef expect_manual_scheduling_mode- expect(container).to have_checked_field("scheduling", visible: :all)+ expect(container)+ .to have_css('[data-test-selector="op-datepicker-modal--scheduling_manual"][data-qa-selected]="true"')enddef expect_automatic_scheduling_mode- expect(container).to have_unchecked_field("scheduling", visible: :all)+ expect(container)+ .to have_css('[data-test-selector="op-datepicker-modal--scheduling_automatic"][data-qa-selected]="true"')enddef toggle_scheduling_mode- find("label", text: "Manual scheduling").click- end-- def scheduling_mode_input- container.find_field "scheduling", visible: :all+ within_test_selector "op-datepicker-modal--scheduling" do+ find_css('[data-qa-selected]="false"').click+ endenddef expect_ignore_non_working_days_disabled- expect(container).to have_field("weekdays_only", disabled: true)+ expect(container)+ .to have_field("work_package[ignore_non_working_days]", disabled: true)enddef expect_ignore_non_working_days_enabled- expect(container).to have_field("weekdays_only", disabled: false)+ expect(container)+ .to have_field("work_package[ignore_non_working_days]", disabled: false)enddef expect_ignore_non_working_days(val, disabled: false)if val- expect(container).to have_unchecked_field("weekdays_only", disabled:)+ expect(container)+ .to have_field("work_package[ignore_non_working_days]", checked: false, disabled:)else- expect(container).to have_checked_field("weekdays_only", disabled:)+ expect(container)+ .to have_field("work_package[ignore_non_working_days]", checked: true, disabled:)endend@@ -165,13 +169,5 @@ module Componentsdef clear_durationset_duration("")end-- def clear_duration_with_icon- duration_field.click-- page- .find('[data-test-selector="op-datepicker-modal--duration-field"] .spot-text-field--clear-button')- .click- endendend