X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Fnode_info_test.exs;h=ff14db4607f50bce7603024afbfd6a406d6f615a;hb=2c9e02429aaab2b9080b75a193142a4dd191631e;hp=9deceb1b5f02cf04842b8c1cd5e4abdb651a04d0;hpb=6e3df116935a549a92b74bfc2be9a4197ad7a995;p=akkoma diff --git a/test/pleroma/web/node_info_test.exs b/test/pleroma/web/node_info_test.exs index 9deceb1b5..ff14db460 100644 --- a/test/pleroma/web/node_info_test.exs +++ b/test/pleroma/web/node_info_test.exs @@ -133,6 +133,7 @@ defmodule Pleroma.Web.NodeInfoTest do default_features = [ "pleroma_api", + "akkoma_api", "mastodon_api", "mastodon_api_streaming", "polls", @@ -140,8 +141,7 @@ defmodule Pleroma.Web.NodeInfoTest do "shareable_emoji_packs", "multifetch", "pleroma_emoji_reactions", - "pleroma:api/v1/notifications:include_types_filter", - "pleroma_chat_messages" + "pleroma:api/v1/notifications:include_types_filter" ] assert MapSet.subset?( @@ -188,6 +188,25 @@ defmodule Pleroma.Web.NodeInfoTest do end end + test "Bubble instances", %{conn: conn} do + clear_config([:instance, :local_bubble], []) + + response = + conn + |> get("/nodeinfo/2.1.json") + |> json_response(:ok) + + assert response["metadata"]["localBubbleInstances"] == [] + clear_config([:instance, :local_bubble], ["example.com"]) + + response = + conn + |> get("/nodeinfo/2.1.json") + |> json_response(:ok) + + assert response["metadata"]["localBubbleInstances"] == ["example.com"] + end + describe "MRF SimplePolicy" do setup do clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.SimplePolicy]) @@ -273,4 +292,38 @@ defmodule Pleroma.Web.NodeInfoTest do assert response["metadata"]["federation"]["mrf_simple_info"] == expected_config end end + + describe "public timeline visibility" do + test "shows public timeline visibility", %{conn: conn} do + clear_config([:restrict_unauthenticated, :timelines], %{local: false, federated: false}) + + response = + conn + |> get("/nodeinfo/2.1.json") + |> json_response(:ok) + + assert response["metadata"]["publicTimelineVisibility"]["local"] == true + assert response["metadata"]["publicTimelineVisibility"]["federated"] == true + + clear_config([:restrict_unauthenticated, :timelines], %{local: true, federated: false}) + + response = + conn + |> get("/nodeinfo/2.1.json") + |> json_response(:ok) + + assert response["metadata"]["publicTimelineVisibility"]["local"] == false + assert response["metadata"]["publicTimelineVisibility"]["federated"] == true + + clear_config([:restrict_unauthenticated, :timelines], %{local: false, federated: true}) + + response = + conn + |> get("/nodeinfo/2.1.json") + |> json_response(:ok) + + assert response["metadata"]["publicTimelineVisibility"]["local"] == true + assert response["metadata"]["publicTimelineVisibility"]["federated"] == false + end + end end