Skip to content

Commit

Permalink
fix failing test in messages of a forum
Browse files Browse the repository at this point in the history
  • Loading branch information
bsatarnejad committed Dec 5, 2024
1 parent 18c4b67 commit 2e78147
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions spec/support/pages/messages/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2e78147

Please sign in to comment.