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

Add AttributeHelperText specs for the Overview Sidebar

Dombi Attila738964885d38
diff --git a/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb b/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb
index 446a9d9d38a..2441210c9af 100644
--- a/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb
+++ b/spec/features/projects/project_custom_fields/overview_page/sidebar_spec.rb
@@ -840,4 +840,20 @@ RSpec.describe "Show project custom fields on project overview page", :js, :with
end
end
end
+
+ describe "with attribute helper texts" do
+ let!(:instance) do
+ create :project_help_text,
+ attribute_name: boolean_project_custom_field.attribute_name
+ end
+ let(:modal) { Components::AttributeHelpTextModal.new(instance) }
+
+ it "displays when active" do
+ overview_page.visit_page
+ # Open help text modal
+ modal.open!
+ expect(modal.modal_container).to have_text "Attribute help text"
+ modal.expect_edit(editable: true)
+ end
+ end
end
diff --git a/spec/features/support/components/attribute_help_text_modal.rb b/spec/features/support/components/attribute_help_text_modal.rb
index a4e20861a4f..2c5a2cf0aa7 100644
--- a/spec/features/support/components/attribute_help_text_modal.rb
+++ b/spec/features/support/components/attribute_help_text_modal.rb
@@ -53,7 +53,7 @@ module Components
def open!
SeleniumHubWaiter.wait
- container.find("[data-qa-help-text-for='#{help_text.attribute_name}']").click
+ container.find("[data-qa-help-text-for='#{help_text.attribute_name.camelize(:lower)}']").click
expect(page).to have_css('[data-test-selector="attribute-help-text--header"]', text: help_text.attribute_caption)
end