Use follower address in user entry.
[akkoma] / test / formatter_test.exs
index 35625f8ff9e7ee096f581279adba913fabfdb493..9b6ee2425e939b8c466fe981b08a2c260b639aa2 100644 (file)
@@ -16,9 +16,9 @@ defmodule Pleroma.FormatterTest do
 
   describe ".parse_tags" do
     test "parses tags in the text" do
-      text = "Here's a #test. Maybe these are #working or not. What about #漢字? And #は。"
+      text = "Here's a #Test. Maybe these are #working or not. What about #漢字? And #は。"
       expected = [
-        {"#test", "test"},
+        {"#Test", "test"},
         {"#working", "working"},
         {"#漢字", "漢字"},
         {"#は", "は"}
@@ -43,4 +43,12 @@ defmodule Pleroma.FormatterTest do
 
     assert Formatter.parse_mentions(text) == expected_result
   end
+
+  test "it adds cool emoji" do
+    text = "I love :moominmamma:"
+
+    expected_result = "I love <img height='32px' width='32px' alt='moominmamma' title='moominmamma' src='#{Pleroma.Web.Endpoint.static_url}/finmoji/128px/moominmamma-128.png' />"
+
+    assert Formatter.finmojifiy(text) == expected_result
+  end
 end