diff options
| author | lain <lain@soykaf.club> | 2020-06-24 13:29:08 +0200 | 
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-06-24 13:29:08 +0200 | 
| commit | 35f6770436837e2e500971a54d51984bd059adfd (patch) | |
| tree | e6fbf5a5702b9c3cce9159b03e12a554dc712d8c /test | |
| parent | 510031ece2ec8761d0555011caaa4fbcd1fc28e4 (diff) | |
| download | pleroma-35f6770436837e2e500971a54d51984bd059adfd.tar.gz pleroma-35f6770436837e2e500971a54d51984bd059adfd.zip | |
StatusView: Add pleroma.parent_visible
Diffstat (limited to 'test')
| -rw-r--r-- | test/web/mastodon_api/views/status_view_test.exs | 19 | 
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 | 
