A platform for community discussion. Free, open, simple.
FIX: target chat-message-text only on secondary action (#24255)
Joffrey JAFFEUX2797e0478e60
diff --git a/plugins/chat/spec/system/page_objects/chat/components/message.rb b/plugins/chat/spec/system/page_objects/chat/components/message.rbindex 07b40169311..83d6b506d66 100644--- a/plugins/chat/spec/system/page_objects/chat/components/message.rb+++ b/plugins/chat/spec/system/page_objects/chat/components/message.rb@@ -32,7 +32,7 @@ module PageObjectsdef secondary_action(action)if page.has_css?("html.mobile-view", wait: 0)- component.click(delay: 0.6)+ component.find(".chat-message-text").click(delay: 0.6)page.find(".chat-message-actions [data-id=\"#{action}\"]").clickelseopen_more_menu@@ -61,10 +61,7 @@ module PageObjectstext = I18n.t("js.chat.deleted", count: args[:deleted]) if args[:deleted]@component =- page.find(- "#{context} #{selector} .chat-message-text",- text: text ? /#{Regexp.escape(text)}/ : nil,- )+ page.find("#{context} #{selector}", text: text ? /#{Regexp.escape(text)}/ : nil)selfenddiff --git a/plugins/chat/spec/system/transcript_spec.rb b/plugins/chat/spec/system/transcript_spec.rbindex ec93ebcaee2..9d8c25eec04 100644--- a/plugins/chat/spec/system/transcript_spec.rb+++ b/plugins/chat/spec/system/transcript_spec.rb@@ -41,7 +41,7 @@ RSpec.describe "Quoting chat message transcripts", type: :system docontext "when quoting a single message into a topic" dofab!(:post_1) { Fabricate(:post) }- fab!(:message_1) { Fabricate(:chat_message, chat_channel: chat_channel_1, use_service: true) }+ fab!(:message_1) { Fabricate(:chat_message, chat_channel: chat_channel_1) }it "quotes the message" dochat_page.visit_channel(chat_channel_1)@@ -62,8 +62,8 @@ RSpec.describe "Quoting chat message transcripts", type: :system docontext "when quoting multiple messages into a topic" dofab!(:post_1) { Fabricate(:post) }- fab!(:message_1) { Fabricate(:chat_message, chat_channel: chat_channel_1, use_service: true) }- fab!(:message_2) { Fabricate(:chat_message, chat_channel: chat_channel_1, use_service: true) }+ fab!(:message_1) { Fabricate(:chat_message, chat_channel: chat_channel_1) }+ fab!(:message_2) { Fabricate(:chat_message, chat_channel: chat_channel_1) }it "quotes the messages" dochat_page.visit_channel(chat_channel_1)@@ -71,8 +71,8 @@ RSpec.describe "Quoting chat message transcripts", type: :system doclip_text = copy_messages_to_clipboard([message_1, message_2])topic_page.visit_topic_and_open_composer(post_1.topic)topic_page.fill_in_composer("This is a new post!\n\n" + clip_text)-within(".d-editor-preview") { expect(page).to have_css(".chat-transcript", count: 2) }+expect(page).to have_content("Originally sent in #{chat_channel_1.name}")topic_page.send_reply@@ -85,7 +85,7 @@ RSpec.describe "Quoting chat message transcripts", type: :system docontext "when quoting a message containing a onebox" dofab!(:post_1) { Fabricate(:post) }- fab!(:message_1) { Fabricate(:chat_message, chat_channel: chat_channel_1, use_service: true) }+ fab!(:message_1) { Fabricate(:chat_message, chat_channel: chat_channel_1) }before doOneboxer.stubs(:preview).returns(@@ -109,7 +109,7 @@ RSpec.describe "Quoting chat message transcripts", type: :system doendcontext "when quoting a message in another message" do- fab!(:message_1) { Fabricate(:chat_message, chat_channel: chat_channel_1, use_service: true) }+ fab!(:message_1) { Fabricate(:chat_message, chat_channel: chat_channel_1) }it "quotes the message" dochat_page.visit_channel(chat_channel_1)@@ -125,7 +125,7 @@ RSpec.describe "Quoting chat message transcripts", type: :system doendcontext "when quoting into a topic directly" do- fab!(:message_1) { Fabricate(:chat_message, chat_channel: chat_channel_1, use_service: true) }+ fab!(:message_1) { Fabricate(:chat_message, chat_channel: chat_channel_1) }let(:topic_title) { "Some topic title for testing" }it "opens the topic composer with correct state" do