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

Close autocompleter in dialog

Oliver Günther4f3704cef196
diff --git a/spec/features/projects/project_custom_fields/overview_page/dialog/validation_spec.rb b/spec/features/projects/project_custom_fields/overview_page/dialog/validation_spec.rb
index 833cc8063f6..6652572d5a3 100644
--- a/spec/features/projects/project_custom_fields/overview_page/dialog/validation_spec.rb
+++ b/spec/features/projects/project_custom_fields/overview_page/dialog/validation_spec.rb
@@ -193,6 +193,7 @@ RSpec.describe "Edit project custom fields on project overview page", :js do
overview_page.open_edit_dialog_for_section(section)
invalid_field.clear
+ valid_field.close_autocompleter
valid_field.clear
valid_field.select_option(first_version.name, third_version.name)
diff --git a/spec/support/components/projects/project_custom_fields/edit_dialog.rb b/spec/support/components/projects/project_custom_fields/edit_dialog.rb
index 3acdfad47f2..0250315b444 100644
--- a/spec/support/components/projects/project_custom_fields/edit_dialog.rb
+++ b/spec/support/components/projects/project_custom_fields/edit_dialog.rb
@@ -96,7 +96,7 @@ module Components
###
def input_containers
- within '.Overlay-body > .FormControl-spacingWrapper' do
+ within '#project-section-edit-form > .FormControl-spacingWrapper' do
page.all('.FormControl-spacingWrapper')
end
end
diff --git a/spec/support/form_fields/primerized/autocomplete_field.rb b/spec/support/form_fields/primerized/autocomplete_field.rb
index 536a3a24dc3..682c062cec3 100644
--- a/spec/support/form_fields/primerized/autocomplete_field.rb
+++ b/spec/support/form_fields/primerized/autocomplete_field.rb
@@ -28,6 +28,12 @@ module FormFields
field_container.find(".ng-select-container input").set text
end
+ def close_autocompleter
+ if page.has_css?(".ng-select-container input", wait: 0.1)
+ field_container.find(".ng-select-container input").send_keys :escape
+ end
+ end
+
def open_options
field_container.find(".ng-select-container").click
end
@@ -69,7 +75,7 @@ module FormFields
end
def expect_error(string = nil)
- expect(field_container).to have_css(".FormControl-inlineValidation")
+ expect(field_container).to have_css(".FormControl-inlineValidation", visible: :all)
expect(field_container).to have_content(string) if string
end
end