Hide follower counter when hiding is activated

This commit is contained in:
Egor Kislitsyn 2019-12-17 13:34:07 +07:00
commit 8f79f433bc
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
2 changed files with 8 additions and 2 deletions

View file

@ -126,7 +126,7 @@ defmodule Pleroma.Web.ActivityPub.UserViewTest do
{:ok, _other_user, user, _activity} = CommonAPI.follow(other_user, user)
assert %{"totalItems" => 1} = UserView.render("followers.json", %{user: user})
user = Map.merge(user, %{hide_followers_count: true, hide_followers: true})
assert %{"totalItems" => 0} = UserView.render("followers.json", %{user: user})
refute UserView.render("followers.json", %{user: user}) |> Map.has_key?("totalItems")
end
test "sets correct totalItems when followers are hidden but the follower counter is not" do