Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
[akkoma] / test / web / common_api / common_api_test.exs
index 41c6909de4b625eb90524c80a859aab0027a62c9..611a9ae66cf5afb6fe7c5cc46380718db7625666 100644 (file)
@@ -50,6 +50,26 @@ defmodule Pleroma.Web.CommonAPITest do
       assert activity
     end
 
+    test "it adds html newlines" do
+      author = insert(:user)
+      recipient = insert(:user)
+
+      other_user = insert(:user)
+
+      {:ok, activity} =
+        CommonAPI.post_chat_message(
+          author,
+          recipient,
+          "uguu\nuguuu"
+        )
+
+      assert other_user.ap_id not in activity.recipients
+
+      object = Object.normalize(activity, false)
+
+      assert object.data["content"] == "uguu<br/>uguuu"
+    end
+
     test "it linkifies" do
       author = insert(:user)
       recipient = insert(:user)