X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fmastodon_api%2Fviews%2Fnotification_view_test.exs;h=c5691341a07cc621aa35f241f7d8e3402d6aa728;hb=a8ca030d85368285af1b960e14dab5b847ecb35a;hp=384fe7253940005966a1daa700eecc57f5dd2a02;hpb=904295d53b82fcfd7dfefd4c970815b36f06faf0;p=akkoma diff --git a/test/web/mastodon_api/views/notification_view_test.exs b/test/web/mastodon_api/views/notification_view_test.exs index 384fe7253..c5691341a 100644 --- a/test/web/mastodon_api/views/notification_view_test.exs +++ b/test/web/mastodon_api/views/notification_view_test.exs @@ -7,6 +7,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do alias Pleroma.Activity alias Pleroma.Chat + alias Pleroma.ChatMessageReference alias Pleroma.Notification alias Pleroma.Object alias Pleroma.Repo @@ -16,7 +17,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do alias Pleroma.Web.MastodonAPI.AccountView alias Pleroma.Web.MastodonAPI.NotificationView alias Pleroma.Web.MastodonAPI.StatusView - alias Pleroma.Web.PleromaAPI.ChatMessageView + alias Pleroma.Web.PleromaAPI.ChatMessageReferenceView import Pleroma.Factory defp test_notifications_rendering(notifications, user, expected_result) do @@ -44,13 +45,15 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do object = Object.normalize(activity) chat = Chat.get(recipient.id, user.ap_id) + cm_ref = ChatMessageReference.for_chat_and_object(chat, object) + expected = %{ id: to_string(notification.id), pleroma: %{is_seen: false}, type: "pleroma:chat_mention", account: AccountView.render("show.json", %{user: user, for: recipient}), chat_message: - ChatMessageView.render("show.json", %{object: object, for: recipient, chat: chat}), + ChatMessageReferenceView.render("show.json", %{chat_message_reference: cm_ref}), created_at: Utils.to_masto_date(notification.inserted_at) }