X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Fmastodon_api%2Fviews%2Fnotification_view_test.exs;h=00e90239ec28b6ead33f4340fc10543b14e26fce;hb=0f5bea2465006bf6a0871812c056ec737ad61949;hp=8070c03c950032c64f2b833fd3d14cb638a47937;hpb=785209decee6797213820466d5e85e7f987ac1d9;p=akkoma diff --git a/test/pleroma/web/mastodon_api/views/notification_view_test.exs b/test/pleroma/web/mastodon_api/views/notification_view_test.exs index 8070c03c9..00e90239e 100644 --- a/test/pleroma/web/mastodon_api/views/notification_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/notification_view_test.exs @@ -188,6 +188,34 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do pleroma: %{is_seen: false, is_muted: false}, type: "pleroma:emoji_reaction", emoji: "☕", + emoji_url: nil, + account: AccountView.render("show.json", %{user: other_user, for: user}), + status: StatusView.render("show.json", %{activity: activity, for: user}), + created_at: Utils.to_masto_date(notification.inserted_at) + } + + test_notifications_rendering([notification], user, [expected]) + end + + test "EmojiReact notification with custom emoji" do + user = insert(:user) + other_user = insert(:user) + + {:ok, activity} = CommonAPI.post(user, %{status: "#morb"}) + {:ok, _activity} = CommonAPI.react_with_emoji(activity.id, other_user, ":dinosaur:") + + activity = Repo.get(Activity, activity.id) + + [notification] = Notification.for_user(user) + + assert notification + + expected = %{ + id: to_string(notification.id), + pleroma: %{is_seen: false, is_muted: false}, + type: "pleroma:emoji_reaction", + emoji: ":dinosaur:", + emoji_url: "http://localhost:4001/emoji/dino walking.gif", account: AccountView.render("show.json", %{user: other_user, for: user}), status: StatusView.render("show.json", %{activity: activity, for: user}), created_at: Utils.to_masto_date(notification.inserted_at)