Merge branch 'announce-validator' into 'develop'
[akkoma] / test / web / common_api / common_api_utils_test.exs
index 5708db6a49deb5d44ffb1051ed241ff53c93cba0..d7d2d10d5c876fe168196914c496ef6a931abcfa 100644 (file)
@@ -297,11 +297,10 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
 
       {to, cc} = Utils.get_to_and_cc(user, mentions, activity, "private", nil)
 
-      assert length(to) == 3
+      assert length(to) == 2
       assert Enum.empty?(cc)
 
       assert mentioned_user.ap_id in to
-      assert third_user.ap_id in to
       assert user.follower_address in to
     end
 
@@ -327,6 +326,15 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
 
       {to, cc} = Utils.get_to_and_cc(user, mentions, activity, "direct", nil)
 
+      assert length(to) == 1
+      assert Enum.empty?(cc)
+
+      assert mentioned_user.ap_id in to
+
+      {:ok, direct_activity} = CommonAPI.post(third_user, %{status: "uguu", visibility: "direct"})
+
+      {to, cc} = Utils.get_to_and_cc(user, mentions, direct_activity, "direct", nil)
+
       assert length(to) == 2
       assert Enum.empty?(cc)