InstanceView: Omit comment if it's empty
This commit is contained in:
parent
656c4368d3
commit
e91bb2144d
2 changed files with 24 additions and 3 deletions
|
|
@ -171,6 +171,22 @@ defmodule Pleroma.Web.MastodonAPI.InstanceControllerTest do
|
|||
] == json_response_and_validate_schema(conn, 200)
|
||||
end
|
||||
|
||||
test "omits comment field if comment is empty", %{conn: conn} do
|
||||
clear_config([:mrf_simple, :reject], ["fediverse.pl"])
|
||||
|
||||
conn = get(conn, "/api/v1/instance/domain_blocks")
|
||||
|
||||
assert [
|
||||
%{
|
||||
"digest" => "55e3f44aefe7eb022d3b1daaf7396cabf7f181bf6093c8ea841e30c9fc7d8226",
|
||||
"domain" => "fediverse.pl",
|
||||
"severity" => "suspend"
|
||||
} = domain_block
|
||||
] = json_response_and_validate_schema(conn, 200)
|
||||
|
||||
refute Map.has_key?(domain_block, "comment")
|
||||
end
|
||||
|
||||
test "returns empty array if mrf transparency is disabled", %{conn: conn} do
|
||||
clear_config([:mrf, :transparency], false)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue