Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into frontend-admin-api
This commit is contained in:
commit
e46c95b826
12 changed files with 66 additions and 10 deletions
|
|
@ -27,6 +27,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AnswerHandlingTest do
|
|||
})
|
||||
|
||||
object = Object.normalize(activity)
|
||||
assert object.data["repliesCount"] == nil
|
||||
|
||||
data =
|
||||
File.read!("test/fixtures/mastodon-vote.json")
|
||||
|
|
@ -41,7 +42,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AnswerHandlingTest do
|
|||
assert answer_object.data["inReplyTo"] == object.data["id"]
|
||||
|
||||
new_object = Object.get_by_ap_id(object.data["id"])
|
||||
assert new_object.data["replies_count"] == object.data["replies_count"]
|
||||
assert new_object.data["repliesCount"] == nil
|
||||
|
||||
assert Enum.any?(
|
||||
new_object.data["oneOf"],
|
||||
|
|
|
|||
|
|
@ -37,12 +37,21 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do
|
|||
status_ids: [activity.id]
|
||||
})
|
||||
|
||||
conn
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|> post("/api/pleroma/admin/reports/#{report_id}/notes", %{
|
||||
content: "this is an admin note"
|
||||
})
|
||||
|
||||
response =
|
||||
conn
|
||||
|> get("/api/pleroma/admin/reports/#{report_id}")
|
||||
|> json_response_and_validate_schema(:ok)
|
||||
|
||||
assert response["id"] == report_id
|
||||
|
||||
[notes] = response["notes"]
|
||||
assert notes["content"] == "this is an admin note"
|
||||
end
|
||||
|
||||
test "returns 404 when report id is invalid", %{conn: conn} do
|
||||
|
|
|
|||
|
|
@ -55,14 +55,35 @@ defmodule Pleroma.Web.MastodonAPI.ConversationControllerTest do
|
|||
|
||||
account_ids = Enum.map(res_accounts, & &1["id"])
|
||||
assert length(res_accounts) == 2
|
||||
assert user_one.id not in account_ids
|
||||
assert user_two.id in account_ids
|
||||
assert user_three.id in account_ids
|
||||
assert is_binary(res_id)
|
||||
assert unread == false
|
||||
assert res_last_status["id"] == direct.id
|
||||
assert res_last_status["account"]["id"] == user_one.id
|
||||
assert Participation.unread_count(user_one) == 0
|
||||
end
|
||||
|
||||
test "includes the user if the user is the only participant", %{
|
||||
user: user_one,
|
||||
conn: conn
|
||||
} do
|
||||
{:ok, _direct} = create_direct_message(user_one, [])
|
||||
|
||||
res_conn = get(conn, "/api/v1/conversations")
|
||||
|
||||
assert response = json_response_and_validate_schema(res_conn, 200)
|
||||
|
||||
assert [
|
||||
%{
|
||||
"accounts" => [account]
|
||||
}
|
||||
] = response
|
||||
|
||||
assert user_one.id == account["id"]
|
||||
end
|
||||
|
||||
test "observes limit params", %{
|
||||
user: user_one,
|
||||
user_two: user_two,
|
||||
|
|
|
|||
|
|
@ -36,9 +36,11 @@ defmodule Pleroma.Web.MastodonAPI.ConversationViewTest do
|
|||
|
||||
assert conversation.id == participation.id |> to_string()
|
||||
assert conversation.last_status.id == activity.id
|
||||
assert conversation.last_status.account.id == user.id
|
||||
|
||||
assert [account] = conversation.accounts
|
||||
assert account.id == other_user.id
|
||||
|
||||
assert conversation.last_status.pleroma.direct_conversation_id == participation.id
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue