summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-07-03 16:44:31 +0200
committerlain <lain@soykaf.club>2020-07-03 16:44:31 +0200
commitd3efb50262e7922fc1aa80625679a7e29bb65836 (patch)
tree1b9c37c851739b041462a5bf50864a4c5d24ffd8 /test/web/mastodon_api
parent244655e884130df6dccabc0d2d78d33857809a36 (diff)
parent19fbfbb767169b58a8f6558d0ad1a9be6425b59d (diff)
downloadpleroma-d3efb50262e7922fc1aa80625679a7e29bb65836.tar.gz
pleroma-d3efb50262e7922fc1aa80625679a7e29bb65836.zip
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into features/mastoapi-2.9.0-status_text
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r--test/web/mastodon_api/controllers/account_controller_test.exs1
-rw-r--r--test/web/mastodon_api/controllers/instance_controller_test.exs2
-rw-r--r--test/web/mastodon_api/views/status_view_test.exs19
3 files changed, 20 insertions, 2 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs
index ebfcedd01..260ad2306 100644
--- a/test/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/web/mastodon_api/controllers/account_controller_test.exs
@@ -780,7 +780,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
assert %{"id" => _id, "muting" => true, "muting_notifications" => true} =
conn
- |> put_req_header("content-type", "application/json")
|> post("/api/v1/accounts/#{other_user.id}/mute")
|> json_response_and_validate_schema(200)
diff --git a/test/web/mastodon_api/controllers/instance_controller_test.exs b/test/web/mastodon_api/controllers/instance_controller_test.exs
index 8bdfdddd1..95ee26416 100644
--- a/test/web/mastodon_api/controllers/instance_controller_test.exs
+++ b/test/web/mastodon_api/controllers/instance_controller_test.exs
@@ -35,8 +35,10 @@ defmodule Pleroma.Web.MastodonAPI.InstanceControllerTest do
"background_image" => _
} = result
+ assert result["pleroma"]["metadata"]["account_activation_required"] != nil
assert result["pleroma"]["metadata"]["features"]
assert result["pleroma"]["metadata"]["federation"]
+ assert result["pleroma"]["metadata"]["fields_limits"]
assert result["pleroma"]["vapid_public_key"]
assert email == from_config_email
diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs
index b6ae4d343..fa26b3129 100644
--- a/test/web/mastodon_api/views/status_view_test.exs
+++ b/test/web/mastodon_api/views/status_view_test.exs
@@ -227,7 +227,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
expires_at: nil,
direct_conversation_id: nil,
thread_muted: false,
- emoji_reactions: []
+ emoji_reactions: [],
+ parent_visible: false
}
}
@@ -621,4 +622,20 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
assert status.visibility == "list"
end
+
+ test "has a field for parent visibility" do
+ user = insert(:user)
+ poster = insert(:user)
+
+ {:ok, invisible} = CommonAPI.post(poster, %{status: "hey", visibility: "private"})
+
+ {:ok, visible} =
+ CommonAPI.post(poster, %{status: "hey", visibility: "private", in_reply_to_id: invisible.id})
+
+ status = StatusView.render("show.json", activity: visible, for: user)
+ refute status.pleroma.parent_visible
+
+ status = StatusView.render("show.json", activity: visible, for: poster)
+ assert status.pleroma.parent_visible
+ end
end