diff --git a/app/components/messages/show_page_header_component.html.erb b/app/components/messages/show_page_header_component.html.erb index e10de5f9c91e..7b7ce34f5323 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 9e4a7da7313b..9e8c8c43973a 100644 --- a/spec/support/pages/messages/show.rb +++ b/spec/support/pages/messages/show.rb @@ -37,7 +37,7 @@ def initialize(message) 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 @@ def quote(content:, quoted_message: nil, subject: nil) click_on "Quote" end else - within ".toolbar-items" do - click_on "Quote" - end + page.find_test_selector("message-quote-button").click end sleep 1