diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-01-22 15:05:39 -0600 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-01-22 15:05:39 -0600 |
commit | ae78059ff433739b83aaa3ccff9245ace153146d (patch) | |
tree | f25e9b709b567b33377c5b9bb0c29a91dbb1c9b9 /test/web/activity_pub | |
parent | 7bfb8ed14d2d222e6fcd7afe54f229f68370f061 (diff) | |
parent | be2777715650d0ac80509f0bd22b4cea8641f9b3 (diff) | |
download | pleroma-ae78059ff433739b83aaa3ccff9245ace153146d.tar.gz pleroma-ae78059ff433739b83aaa3ccff9245ace153146d.zip |
Merge branch 'develop' into features/remote-follow-userpage-redirect
Diffstat (limited to 'test/web/activity_pub')
-rw-r--r-- | test/web/activity_pub/activity_pub_test.exs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index ad6b9810c..ff4604a52 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -867,6 +867,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do test "adds an emoji reaction activity to the db" do user = insert(:user) reactor = insert(:user) + third_user = insert(:user) + fourth_user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => "YASSSS queen slay"}) assert object = Object.normalize(activity) @@ -881,7 +883,21 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert reaction_activity.data["to"] == [User.ap_followers(reactor), activity.data["actor"]] assert reaction_activity.data["context"] == object.data["context"] assert object.data["reaction_count"] == 1 - assert object.data["reactions"]["🔥"] == [reactor.ap_id] + assert object.data["reactions"] == [["🔥", [reactor.ap_id]]] + + {:ok, _reaction_activity, object} = ActivityPub.react_with_emoji(third_user, object, "☕") + + assert object.data["reaction_count"] == 2 + assert object.data["reactions"] == [["🔥", [reactor.ap_id]], ["☕", [third_user.ap_id]]] + + {:ok, _reaction_activity, object} = ActivityPub.react_with_emoji(fourth_user, object, "🔥") + + assert object.data["reaction_count"] == 3 + + assert object.data["reactions"] == [ + ["🔥", [fourth_user.ap_id, reactor.ap_id]], + ["☕", [third_user.ap_id]] + ] end end @@ -919,7 +935,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do object = Object.get_by_ap_id(object.data["id"]) assert object.data["reaction_count"] == 0 - assert object.data["reactions"] == %{} + assert object.data["reactions"] == [] end end |