Merge branch 'develop' into refactor/notification_settings
[akkoma] / test / web / streamer / streamer_test.exs
index dfe341b34775bfe6773eaa599e1fa22c8c590566..d56d7446448e10217d9e921d5db896bb05a92fa8 100644 (file)
@@ -128,6 +128,23 @@ defmodule Pleroma.Web.StreamerTest do
       assert Streamer.filtered_by_user?(user, announce)
     end
 
+    test "it does stream notifications announces of the user's own posts in the 'user' stream", %{
+      user: user
+    } do
+      Streamer.get_topic_and_add_socket("user", user)
+
+      other_user = insert(:user)
+      {:ok, activity} = CommonAPI.post(user, %{status: "hey"})
+      {:ok, announce} = CommonAPI.repeat(activity.id, other_user)
+
+      notification =
+        Pleroma.Notification
+        |> Repo.get_by(%{user_id: user.id, activity_id: announce.id})
+        |> Repo.preload(:activity)
+
+      refute Streamer.filtered_by_user?(user, notification)
+    end
+
     test "it streams boosts of mastodon user in the 'user' stream", %{user: user} do
       Streamer.get_topic_and_add_socket("user", user)