summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/views
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-30 11:40:34 +0200
committerlain <lain@soykaf.club>2020-06-30 11:40:34 +0200
commit0176b7bca2e64f82228129024ac059e3bee00675 (patch)
treec7e092a07c8ec5d672142dc56a72fae8981422f3 /test/web/mastodon_api/views
parent8630a6c7f52a68ab32025b1c80a6398599908c68 (diff)
parent2382a2a1511e1042d960946aacfde7a49fac9dd0 (diff)
downloadpleroma-0176b7bca2e64f82228129024ac059e3bee00675.tar.gz
pleroma-0176b7bca2e64f82228129024ac059e3bee00675.zip
Merge branch 'preload-fixups-2' into preloadfixups
Diffstat (limited to 'test/web/mastodon_api/views')
-rw-r--r--test/web/mastodon_api/views/status_view_test.exs19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs
index 5cbadf0fc..f90a0c273 100644
--- a/test/web/mastodon_api/views/status_view_test.exs
+++ b/test/web/mastodon_api/views/status_view_test.exs
@@ -226,7 +226,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
expires_at: nil,
direct_conversation_id: nil,
thread_muted: false,
- emoji_reactions: []
+ emoji_reactions: [],
+ parent_visible: false
}
}
@@ -620,4 +621,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