summaryrefslogtreecommitdiff
path: root/test/notification_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-08 09:23:01 +0000
committerlain <lain@soykaf.club>2020-05-08 09:23:01 +0000
commit0cf43391f272b2bb756b564e12bbcd3efda6a4bd (patch)
tree3ce1732a3a997de5070e005f9b4102a5c01c878c /test/notification_test.exs
parent218a22c9a36ff2f8de353110f0badfc1ec5aa0f2 (diff)
parenta081135365c2b9d7bc81ee84baffbc3c2be68e8c (diff)
downloadpleroma-0cf43391f272b2bb756b564e12bbcd3efda6a4bd.tar.gz
pleroma-0cf43391f272b2bb756b564e12bbcd3efda6a4bd.zip
Merge branch 'issue/1276-2' into 'develop'
[#1276] added an endpoint for getting unread notification count See merge request pleroma/pleroma!2392
Diffstat (limited to 'test/notification_test.exs')
-rw-r--r--test/notification_test.exs13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs
index 7f359711f..69f426e4d 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -47,6 +47,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
@@ -466,6 +469,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