projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into issue/2099
[akkoma]
/
test
/
web
/
pleroma_api
/
views
/
chat_view_test.exs
diff --git
a/test/web/pleroma_api/views/chat_view_test.exs
b/test/web/pleroma_api/views/chat_view_test.exs
index 6062a0cfef122d2e469d510141d63228c8ae0d2e..02484b705b7ccd380fd60d41d1eb5b5ea2602ba1 100644
(file)
--- a/
test/web/pleroma_api/views/chat_view_test.exs
+++ b/
test/web/pleroma_api/views/chat_view_test.exs
@@
-6,11
+6,12
@@
defmodule Pleroma.Web.PleromaAPI.ChatViewTest do
use Pleroma.DataCase
alias Pleroma.Chat
use Pleroma.DataCase
alias Pleroma.Chat
+ alias Pleroma.Chat.MessageReference
alias Pleroma.Object
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.MastodonAPI.AccountView
alias Pleroma.Object
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.MastodonAPI.AccountView
- alias Pleroma.Web.PleromaAPI.Chat
Messag
eView
+ alias Pleroma.Web.PleromaAPI.Chat
.MessageReferenc
eView
alias Pleroma.Web.PleromaAPI.ChatView
import Pleroma.Factory
alias Pleroma.Web.PleromaAPI.ChatView
import Pleroma.Factory
@@
-25,7
+26,8
@@
defmodule Pleroma.Web.PleromaAPI.ChatViewTest do
assert represented_chat == %{
id: "#{chat.id}",
assert represented_chat == %{
id: "#{chat.id}",
- account: AccountView.render("show.json", user: recipient),
+ account:
+ AccountView.render("show.json", user: recipient, skip_visibility_check: true),
unread: 0,
last_message: nil,
updated_at: Utils.to_masto_date(chat.updated_at)
unread: 0,
last_message: nil,
updated_at: Utils.to_masto_date(chat.updated_at)
@@
-39,7
+41,9
@@
defmodule Pleroma.Web.PleromaAPI.ChatViewTest do
represented_chat = ChatView.render("show.json", chat: chat)
represented_chat = ChatView.render("show.json", chat: chat)
+ cm_ref = MessageReference.for_chat_and_object(chat, chat_message)
+
assert represented_chat[:last_message] ==
assert represented_chat[:last_message] ==
-
ChatMessageView.render("show.json", chat: chat, object: chat_message
)
+
MessageReferenceView.render("show.json", chat_message_reference: cm_ref
)
end
end
end
end