diff options
author | rinpatch <rinpatch@sdf.org> | 2021-02-08 10:31:20 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2021-02-08 10:31:20 +0000 |
commit | 8babd796da46975c2d976cf87dad844c13e8a69e (patch) | |
tree | 82425003f80c949d545bfb7b2d3db3d948c896cf /test | |
parent | 6e68058b634dced932a1283f8470598b5cabdfeb (diff) | |
parent | d04737229196a08db4bc726f8afd55a64dcf8304 (diff) | |
download | pleroma-8babd796da46975c2d976cf87dad844c13e8a69e.tar.gz |
Merge branch 'fix/reports-from-admins' into 'develop'
Suppress report notification for admin actors
See merge request pleroma/pleroma!3301
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/notification_test.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/pleroma/notification_test.exs b/test/pleroma/notification_test.exs index 0c6ebfb76..948587292 100644 --- a/test/pleroma/notification_test.exs +++ b/test/pleroma/notification_test.exs @@ -45,6 +45,20 @@ defmodule Pleroma.NotificationTest do assert notification.type == "pleroma:report" end + test "suppresses notification to reporter if reporter is an admin" do + reporting_admin = insert(:user, is_admin: true) + reported_user = insert(:user) + other_admin = insert(:user, is_admin: true) + + {:ok, activity} = CommonAPI.report(reporting_admin, %{account_id: reported_user.id}) + + {:ok, [notification]} = Notification.create_notifications(activity) + + refute notification.user_id == reporting_admin.id + assert notification.user_id == other_admin.id + assert notification.type == "pleroma:report" + end + test "creates a notification for an emoji reaction" do user = insert(:user) other_user = insert(:user) |