X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Fpush%2Fimpl_test.exs;h=2a4a8fd06269e199112c86458d213a46b31deef1;hb=5d1548609843952bffa514af96e714756a7091ec;hp=6cab46696dede96a40a9a4a618f0834ec3892968;hpb=409f694e4f90d34285b43c7e7afc594bc386d893;p=akkoma diff --git a/test/pleroma/web/push/impl_test.exs b/test/pleroma/web/push/impl_test.exs index 6cab46696..2a4a8fd06 100644 --- a/test/pleroma/web/push/impl_test.exs +++ b/test/pleroma/web/push/impl_test.exs @@ -184,6 +184,24 @@ defmodule Pleroma.Web.Push.ImplTest do "New Favorite" end + test "renders title and body for pleroma:emoji_reaction activity" do + user = insert(:user, nickname: "Bob") + + {:ok, activity} = + CommonAPI.post(user, %{ + status: "This post is a really good post!" + }) + + {:ok, activity} = CommonAPI.react_with_emoji(activity.id, user, "👍") + object = Object.normalize(activity) + + assert Impl.format_body(%{activity: activity, type: "pleroma:emoji_reaction"}, user, object) == + "@Bob reacted with 👍" + + assert Impl.format_title(%{activity: activity, type: "pleroma:emoji_reaction"}) == + "New Reaction" + end + test "renders title for create activity with direct visibility" do user = insert(:user, nickname: "Bob") @@ -219,7 +237,7 @@ defmodule Pleroma.Web.Push.ImplTest do recipient = insert(:user) file = %Plug.Upload{ - content_type: "image/jpg", + content_type: "image/jpeg", path: Path.absname("test/fixtures/image.jpg"), filename: "an_image.jpg" }