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

Use capybara rich text selector for label assertion

Kabiru Mwenja88415dca8401
diff --git a/spec/features/activities/work_package/activity_tab_comment_editor_spec.rb b/spec/features/activities/work_package/activity_tab_comment_editor_spec.rb
index 493712e0482..8f573f09e93 100644
--- a/spec/features/activities/work_package/activity_tab_comment_editor_spec.rb
+++ b/spec/features/activities/work_package/activity_tab_comment_editor_spec.rb
@@ -130,19 +130,12 @@ RSpec.describe "Work package activity tab comment editor",
activity_tab.add_comment(text: "Sample text", save: false)
activity_tab.expect_focus_on_editor
- expect_rich_text_to_be_aria_labelled
+ expect(page).to have_selector(:rich_text, "Add a comment. Type @ to notify people.")
activity_tab.clear_comment(blur: true)
activity_tab.expect_blur_on_editor
- expect_rich_text_to_be_aria_labelled
- end
-
- def expect_rich_text_to_be_aria_labelled
- expect(page).to have_selector(:label, for: "journal_notes", class: "sr-only",
- text: "Add a comment. Type @ to notify people.")
- label_id = page.find('label[for="journal_notes"]')["id"]
- expect(page).to have_selector(:rich_text, aria: { labelledby: label_id })
+ expect(page).to have_selector(:rich_text, "Add a comment. Type @ to notify people.")
end
end