Add test to ensure the blocked cease to have follow relationship to the blocker
authorTusooa Zhu <tusooa@kazv.moe>
Fri, 17 Dec 2021 19:42:45 +0000 (14:42 -0500)
committerTusooa Zhu <tusooa@kazv.moe>
Fri, 17 Dec 2021 19:44:28 +0000 (14:44 -0500)
https://git.pleroma.social/pleroma/pleroma/-/issues/2766

test/pleroma/web/activity_pub/side_effects_test.exs

index d0988619dcade410815840c611ec9e0585f80621..5ca68ccc8c8c672c718c66f00cb4e01ce1c3c2f9 100644 (file)
@@ -88,6 +88,16 @@ defmodule Pleroma.Web.ActivityPub.SideEffectsTest do
       assert User.blocks?(user, blocked)
     end
 
+    test "it updates following relationship", %{user: user, blocked: blocked, block: block} do
+      {:ok, _, _} = SideEffects.handle(block)
+
+      refute Pleroma.FollowingRelationship.get(user, blocked)
+      assert User.get_follow_state(user, blocked) == nil
+      assert User.get_follow_state(blocked, user) == nil
+      assert User.get_follow_state(user, blocked, nil) == nil
+      assert User.get_follow_state(blocked, user, nil) == nil
+    end
+
     test "it blocks but does not unfollow if the relevant setting is set", %{
       user: user,
       blocked: blocked,