Allow custom emoji reactions: add test for mixed emoji react, fix credo errors
This commit is contained in:
parent
4b85d1c617
commit
8d3b29aaba
|
@ -14,10 +14,10 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do
|
||||||
alias Pleroma.Web.AdminAPI.Report
|
alias Pleroma.Web.AdminAPI.Report
|
||||||
alias Pleroma.Web.AdminAPI.ReportView
|
alias Pleroma.Web.AdminAPI.ReportView
|
||||||
alias Pleroma.Web.CommonAPI
|
alias Pleroma.Web.CommonAPI
|
||||||
alias Pleroma.Web.MediaProxy
|
|
||||||
alias Pleroma.Web.MastodonAPI.AccountView
|
alias Pleroma.Web.MastodonAPI.AccountView
|
||||||
alias Pleroma.Web.MastodonAPI.NotificationView
|
alias Pleroma.Web.MastodonAPI.NotificationView
|
||||||
alias Pleroma.Web.MastodonAPI.StatusView
|
alias Pleroma.Web.MastodonAPI.StatusView
|
||||||
|
alias Pleroma.Web.MediaProxy
|
||||||
alias Pleroma.Web.PleromaAPI.Chat.MessageReferenceView
|
alias Pleroma.Web.PleromaAPI.Chat.MessageReferenceView
|
||||||
|
|
||||||
defp object_id_for(%{data: %{"object" => %{"id" => id}}}) when is_binary(id), do: id
|
defp object_id_for(%{data: %{"object" => %{"id" => id}}}) when is_binary(id), do: id
|
||||||
|
|
|
@ -76,7 +76,12 @@ test "PUT /api/v1/pleroma/statuses/:id/reactions/:emoji", %{conn: conn} do
|
||||||
note =
|
note =
|
||||||
insert(:note,
|
insert(:note,
|
||||||
user: user,
|
user: user,
|
||||||
data: %{"reactions" => [["wow", [other_user.ap_id], "https://remote/emoji/wow"]]}
|
data: %{
|
||||||
|
"reactions" => [
|
||||||
|
["👍", [other_user.ap_id], nil],
|
||||||
|
["wow", [other_user.ap_id], "https://remote/emoji/wow"]
|
||||||
|
]
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
activity = insert(:note_activity, note: note, user: user)
|
activity = insert(:note_activity, note: note, user: user)
|
||||||
|
@ -89,6 +94,13 @@ test "PUT /api/v1/pleroma/statuses/:id/reactions/:emoji", %{conn: conn} do
|
||||||
|> json_response(200)
|
|> json_response(200)
|
||||||
|
|
||||||
assert result["pleroma"]["emoji_reactions"] == [
|
assert result["pleroma"]["emoji_reactions"] == [
|
||||||
|
%{
|
||||||
|
"account_ids" => [other_user.id],
|
||||||
|
"count" => 1,
|
||||||
|
"me" => false,
|
||||||
|
"name" => "👍",
|
||||||
|
"url" => nil
|
||||||
|
},
|
||||||
%{
|
%{
|
||||||
"name" => "wow@remote",
|
"name" => "wow@remote",
|
||||||
"count" => 2,
|
"count" => 2,
|
||||||
|
|
Loading…
Reference in New Issue