FIX: correctly highlights message on reply click (#24431)

This commit is contained in:
Joffrey JAFFEUX 2023-11-17 18:05:38 +01:00 committed by GitHub
parent 878b9ce549
commit 2b7ecee06e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -11,6 +11,7 @@
{{did-insert this.didUpdateChannel}}
{{did-insert this.addAutoFocusEventListener}}
{{will-destroy this.removeAutoFocusEventListener}}
{{did-update this.loadMessages @targetMessageId}}
data-id={{@channel.id}}
>
<ChatFullPageHeader

View File

@ -99,4 +99,19 @@ RSpec.describe "Chat | composer | channel", type: :system, js: true do
end
end
end
context "when click on reply indicator" do
before do
Fabricate(:chat_message, chat_channel: channel_1)
Fabricate(:chat_message, chat_channel: channel_1, in_reply_to: message_1)
end
it "highlights the message" do
chat_page.visit_channel(channel_1)
page.find(".chat-reply").click
expect(channel_page.messages).to have_message(id: message_1.id, highlighted: true)
end
end
end

View File

@ -104,6 +104,7 @@ module PageObjects
selector += ".-persisted" if args[:persisted]
selector += ".-staged" if args[:staged]
selector += ".-deleted" if args[:deleted]
selector += ".-highlighted" if args[:highlighted]
selector
end
end