diff options
author | lain <lain@soykaf.club> | 2020-06-29 17:48:18 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-06-29 17:48:18 +0200 |
commit | 90083a754dc0bfe0c8a04fbaa3e78f68a848035e (patch) | |
tree | 22039e64370a60fe7e367ee2e292d46f9af2cf3d /test | |
parent | dc31fbfe6ce0c43d2ae0ce32f3101950f0d24813 (diff) | |
download | pleroma-90083a754dc0bfe0c8a04fbaa3e78f68a848035e.tar.gz pleroma-90083a754dc0bfe0c8a04fbaa3e78f68a848035e.zip |
Notifications: Never return `nil` in the notification list.
Diffstat (limited to 'test')
-rw-r--r-- | test/notification_test.exs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs index 526f43fab..5389dabca 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -21,7 +21,19 @@ defmodule Pleroma.NotificationTest do alias Pleroma.Web.Push alias Pleroma.Web.Streamer + # TODO: Test there's no nil notifications + describe "create_notifications" do + test "never returns nil" do + user = insert(:user) + other_user = insert(:user, %{invisible: true}) + + {:ok, activity} = CommonAPI.post(user, %{status: "yeah"}) + {:ok, activity} = CommonAPI.react_with_emoji(activity.id, other_user, "☕") + + refute {:ok, [nil]} == Notification.create_notifications(activity) + end + test "creates a notification for an emoji reaction" do user = insert(:user) other_user = insert(:user) |