diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-04-14 06:38:56 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-04-14 06:38:56 +0000 |
commit | 60cc7d6c9a2ec60c3a98f0fe51d68d3dbd5d21c2 (patch) | |
tree | f037060e2d82eb69c3eca0151ce78ca53c7962b9 /test/notification_test.exs | |
parent | e3db1c471e2f52a5bbdc854b594fa08342edf181 (diff) | |
parent | a16b3dbcbf19d584eaefbecbfb4ff34fa7b3743a (diff) | |
download | pleroma-60cc7d6c9a2ec60c3a98f0fe51d68d3dbd5d21c2.tar.gz pleroma-60cc7d6c9a2ec60c3a98f0fe51d68d3dbd5d21c2.zip |
Merge branch 'issue/1276' into 'develop'
[#1276] An endpoint for getting unread notification count
Closes #1276
See merge request pleroma/pleroma!1877
Diffstat (limited to 'test/notification_test.exs')
-rw-r--r-- | test/notification_test.exs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs index 837a9dacd..f78a47af6 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -45,6 +45,9 @@ defmodule Pleroma.NotificationTest do assert notified_ids == [other_user.id, third_user.id] assert notification.activity_id == activity.id assert other_notification.activity_id == activity.id + + assert [%Pleroma.Marker{unread_count: 2}] = + Pleroma.Marker.get_markers(other_user, ["notifications"]) end test "it creates a notification for subscribed users" do @@ -410,6 +413,16 @@ defmodule Pleroma.NotificationTest do assert n1.seen == true assert n2.seen == true assert n3.seen == false + + assert %Pleroma.Marker{} = + m = + Pleroma.Repo.get_by( + Pleroma.Marker, + user_id: other_user.id, + timeline: "notifications" + ) + + assert m.last_read_id == to_string(n2.id) end end |