mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-06 00:52:45 -05:00
Test custom emoji fallback escaping
This commit is contained in:
parent
7bad4c1ebc
commit
2338e30185
@ -121,6 +121,25 @@ Spectator.describe "parse_description" do
|
||||
)
|
||||
end
|
||||
|
||||
it "escapes an attachment fallback exactly once when its label is absent" do
|
||||
description = JSON.parse(%({
|
||||
"content":"<&",
|
||||
"attachmentRuns":[{
|
||||
"startIndex":0,
|
||||
"length":2,
|
||||
"element":{"type":{"imageType":{"image":{"sources":[{
|
||||
"url":"https://lh3.googleusercontent.com/custom=s16",
|
||||
"width":16,
|
||||
"height":16
|
||||
}]}}}}
|
||||
}]
|
||||
}))
|
||||
|
||||
expect(parse_description(description, "video-id")).to eq(
|
||||
%(<img alt="<&" src="/ggpht/custom=s16" title="<&" width="16" height="16" class="channel-emoji" />)
|
||||
)
|
||||
end
|
||||
|
||||
it "does not render zero-length graphical attachments" do
|
||||
description = JSON.parse(%({
|
||||
"content":"plain text",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user