Test angry face in formatter D:< #1968

This commit is contained in:
Alex Gleason 2020-07-18 15:10:48 -05:00
parent 613e096389
commit ae74c52e22
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 20 additions and 0 deletions

View File

@ -265,6 +265,26 @@ test "it parses URL containing local mention" do
assert {^expected, [], []} = Formatter.linkify(text) assert {^expected, [], []} = Formatter.linkify(text)
end end
test "it correctly parses angry face D:< with mention" do
lain =
insert(:user, %{
nickname: "lain@lain.com",
ap_id: "https://lain.com/users/lain",
id: "9qrWmR0cKniB0YU0TA"
})
text = "@lain@lain.com D:<"
expected_text =
~S(<span class="h-card"><a class="u-url mention" data-user="9qrWmR0cKniB0YU0TA" href="https://lain.com/users/lain" rel="ugc">@<span>lain</span></a></span> D:<)
expected_mentions = [
{"@lain@lain.com", lain}
]
assert {^expected_text, ^expected_mentions, []} = Formatter.linkify(text)
end
end end
describe ".parse_tags" do describe ".parse_tags" do