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
[#65074] specs for project attribute in section creation
Tobias Dillmann344df0bf3583
diff --git a/app/components/settings/project_custom_field_sections/show_component.html.erb b/app/components/settings/project_custom_field_sections/show_component.html.erbindex 1128d8b2698..ed7754e9647 100644--- a/app/components/settings/project_custom_field_sections/show_component.html.erb+++ b/app/components/settings/project_custom_field_sections/show_component.html.erb@@ -46,7 +46,7 @@render(Primer::Beta::Text.new(color: :subtle)) { t("settings.project_attributes.label_no_project_custom_fields") }endempty_list_container.with_column do- render(Primer::Alpha::ActionMenu.new(data: { test_selector: "new-project-custom-field-button" })) do |menu|+ render(Primer::Alpha::ActionMenu.new(data: { test_selector: "new-project-custom-field-in-section-button" })) do |menu|menu.with_show_button(scheme: :secondary,"aria-label": t("settings.project_attributes.label_new_attribute")diff --git a/app/components/settings/project_custom_field_sections/show_component.rb b/app/components/settings/project_custom_field_sections/show_component.rbindex f41488640c4..6090ae91c5f 100644--- a/app/components/settings/project_custom_field_sections/show_component.rb+++ b/app/components/settings/project_custom_field_sections/show_component.rb@@ -147,7 +147,7 @@ module Settingscustom_field_section_id: @project_custom_field_section.id),content_arguments: { data: { turbo: "false",- test_selector: "new-project-custom-field-button" } }+ test_selector: "new-project-custom-field-in-section-button-#{format.name}" } })endenddiff --git a/spec/features/admin/custom_fields/projects/index_spec.rb b/spec/features/admin/custom_fields/projects/index_spec.rbindex e472296ce48..51d0bc31cb1 100644--- a/spec/features/admin/custom_fields/projects/index_spec.rb+++ b/spec/features/admin/custom_fields/projects/index_spec.rb@@ -243,7 +243,7 @@ RSpec.describe "List project custom fields", :js doit "redirects to the custom field new page via button in empty sections" dowithin_project_custom_field_section_container(section_for_multi_select_fields) do- expect(page).not_to have_test_selector("new-project-custom-field-button")+ expect(page).not_to have_test_selector("new-project-custom-field-in-section-button")endmulti_list_project_custom_field.destroy@@ -253,11 +253,12 @@ RSpec.describe "List project custom fields", :js docf_index_page.visit!within_project_custom_field_section_container(section_for_multi_select_fields) do- page.find_test_selector("new-project-custom-field-button").click+ page.find_test_selector("new-project-custom-field-in-section-button").click+ page.find_test_selector("new-project-custom-field-in-section-button-int").clickendexpect(page).to have_current_path(new_admin_settings_project_custom_field_path(- type: "ProjectCustomField",+ field_format: "int",custom_field_section_id: section_for_multi_select_fields.id))end