From ae74c52e222c6e230ac04f484306c0a16aa270a5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 18 Jul 2020 15:10:48 -0500 Subject: [PATCH] Test angry face in formatter D:< #1968 --- test/formatter_test.exs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/formatter_test.exs b/test/formatter_test.exs index ae0d7b377..8713ab9c2 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -265,6 +265,26 @@ defmodule Pleroma.FormatterTest do assert {^expected, [], []} = Formatter.linkify(text) 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(@lain D:<) + + expected_mentions = [ + {"@lain@lain.com", lain} + ] + + assert {^expected_text, ^expected_mentions, []} = Formatter.linkify(text) + end end describe ".parse_tags" do