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

fix failing test in messages of a forum

Behrokh Satarnejad2e7814782276
diff --git a/app/components/messages/show_page_header_component.html.erb b/app/components/messages/show_page_header_component.html.erb
index e10de5f9c91..7b7ce34f532 100644
--- a/app/components/messages/show_page_header_component.html.erb
+++ b/app/components/messages/show_page_header_component.html.erb
@@ -17,7 +17,7 @@
size: :medium,
href: url_for({ action: 'quote', id: @topic }),
aria: { label: I18n.t(:button_delete) },
- data: { 'action': 'forum-messages#quote' },
+ data: { 'action': 'forum-messages#quote', test_selector: "message-quote-button" },
title: t(:button_quote)) do |button|
button.with_leading_visual_icon(icon: :quote)
t(:button_quote)
diff --git a/spec/support/pages/messages/show.rb b/spec/support/pages/messages/show.rb
index 9e4a7da7313..9e8c8c43973 100644
--- a/spec/support/pages/messages/show.rb
+++ b/spec/support/pages/messages/show.rb
@@ -37,7 +37,7 @@ module Pages::Messages
end
def expect_subject(subject)
- expect(page).to have_css(".title-container", text: subject)
+ expect(page).to have_css(".PageHeader-title", text: subject)
end
def expect_content(content)
@@ -68,9 +68,7 @@ module Pages::Messages
click_on "Quote"
end
else
- within ".toolbar-items" do
- click_on "Quote"
- end
+ page.find_test_selector("message-quote-button").click
end
sleep 1