Skip to content

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

tests[Op#54749]: add feature tests fr linking project

Kabiru Mwenja3ebbb7236038
diff --git a/spec/features/admin/project_custom_fields/project_mappings_spec.rb b/spec/features/admin/project_custom_fields/project_mappings_spec.rb
index 2491b114c14..93f226dd3f5 100644
--- a/spec/features/admin/project_custom_fields/project_mappings_spec.rb
+++ b/spec/features/admin/project_custom_fields/project_mappings_spec.rb
@@ -82,6 +82,24 @@ RSpec.describe "Project Custom Field Mappings", :js do
end
end
+ it "allows to link a project" do
+ project = create(:project)
+ subproject = create(:project, parent: project)
+ click_on "Add projects"
+
+ within_test_selector("settings--new-project-custom-field-mapping-component") do
+ autocompleter = page.find(".op-project-autocompleter")
+ autocompleter.fill_in with: project.name
+ find(".ng-option-label", text: project.name).click
+ check "Include sub-projects"
+
+ click_on "Add"
+ end
+
+ expect(page).to have_text(project.name)
+ expect(page).to have_text(subproject.name)
+ end
+
context "and the project custom field is required" do
shared_let(:project_custom_field) { create(:project_custom_field, is_required: true) }