diff options
author | Mark Felder <feld@feld.me> | 2021-02-03 12:54:53 -0600 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2021-02-03 12:54:53 -0600 |
commit | 5bb5949048b6eeb236cca450c8399ac412fbd2a8 (patch) | |
tree | 9a1be48f24d79c96409bb813a28dd5adaf17706d | |
parent | 76f732766ba36c3a94cf6b8b39fb745c1cf3f49a (diff) | |
download | pleroma-5bb5949048b6eeb236cca450c8399ac412fbd2a8.tar.gz |
Validate admin making report doesn't get their own report notification, but other admins do
-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) |