diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-04-15 21:19:43 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-04-15 21:19:43 +0300 |
commit | 4b3b1fec4e57bd07ac75700bf34cd188ce43b545 (patch) | |
tree | aa8ea05fa7740b34fe80edf77e448fa0cda7e445 /test/notification_test.exs | |
parent | b1c1d2e5e1e1c43a068a7223f9ba69c689c878a3 (diff) | |
download | pleroma-4b3b1fec4e57bd07ac75700bf34cd188ce43b545.tar.gz pleroma-4b3b1fec4e57bd07ac75700bf34cd188ce43b545.zip |
added an endpoint for getting unread notification count
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 |