summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-29 08:39:51 +0000
committerlain <lain@soykaf.club>2020-06-29 08:39:51 +0000
commit577da132da692a205bd8f3b454db8f9cf235a610 (patch)
tree9443eae81726143e15ab3c3d20e2546f259cbd96 /test
parente229640372b7b00c71ea8c7f523d018b01d270f3 (diff)
parent4c5fb831b3b59309a475a141eb73cc440533d0ff (diff)
downloadpleroma-577da132da692a205bd8f3b454db8f9cf235a610.tar.gz
pleroma-577da132da692a205bd8f3b454db8f9cf235a610.zip
Merge branch '1031-parent-visible' into 'develop'
Resolve "Add `pleroma.parent_visible` to the status view" Closes #1031 See merge request pleroma/pleroma!2679
Diffstat (limited to 'test')
-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