mirror of
https://github.com/discourse/discourse.git
synced 2025-03-28 20:48:53 +08:00
DEV: correctly tests text is rendered in replies (#20845)
This commit is contained in:
parent
3d0b67372f
commit
05174a6abd
@ -3,9 +3,9 @@
|
|||||||
{{d-icon this.icon}}
|
{{d-icon this.icon}}
|
||||||
<ChatUserAvatar @user={{this.message.user}} />
|
<ChatUserAvatar @user={{this.message.user}} />
|
||||||
<span class="chat-reply__username">{{this.message.user.username}}</span>
|
<span class="chat-reply__username">{{this.message.user.username}}</span>
|
||||||
<span class="chat-reply__excerpt">{{replace-emoji
|
<span class="chat-reply__excerpt">
|
||||||
this.message.excerpt
|
{{replace-emoji this.message.excerpt}}
|
||||||
}}</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FlatButton
|
<FlatButton
|
||||||
|
@ -189,7 +189,7 @@ RSpec.describe "Chat channel", type: :system, js: true do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when replying to message that has tags" do
|
context "when replying to message that has HTML tags" do
|
||||||
fab!(:other_user) { Fabricate(:user) }
|
fab!(:other_user) { Fabricate(:user) }
|
||||||
fab!(:message_2) do
|
fab!(:message_2) do
|
||||||
Fabricate(
|
Fabricate(
|
||||||
@ -208,12 +208,10 @@ RSpec.describe "Chat channel", type: :system, js: true do
|
|||||||
sign_in(current_user)
|
sign_in(current_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
xit "escapes the reply-to line" do
|
it "renders text in the reply-to" do
|
||||||
chat.visit_channel(channel_1)
|
chat.visit_channel(channel_1)
|
||||||
|
|
||||||
expect(find(".chat-reply .chat-reply__excerpt")["innerHTML"].strip).to eq(
|
expect(find(".chat-reply .chat-reply__excerpt")["innerHTML"].strip).to eq("not marked")
|
||||||
"<mark>not marked</mark>",
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,6 +31,19 @@ RSpec.describe "Chat composer", type: :system, js: true do
|
|||||||
text: message_1.user.username,
|
text: message_1.user.username,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "with HTML tags" do
|
||||||
|
before { message_1.update!(message: "<mark>not marked</mark>") }
|
||||||
|
|
||||||
|
it "renders text in the details" do
|
||||||
|
chat.visit_channel(channel_1)
|
||||||
|
channel.reply_to(message_1)
|
||||||
|
|
||||||
|
expect(
|
||||||
|
find(".chat-composer-message-details .chat-reply__excerpt")["innerHTML"].strip,
|
||||||
|
).to eq("not marked")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when editing a message" do
|
context "when editing a message" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user