logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/
commit: 950bf60765cd4eff8f29717dd7a487b8cdf395f8
parent ef216c922fbd2b96de2f1e99bae8d4ddb3700fdc
Author: Lain Soykaf <lain@lain.com>
Date:   Wed, 19 Mar 2025 15:57:08 +0400

LikeHandlingTest: Add test for invalid content

Diffstat:

Mtest/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs @@ -126,4 +126,20 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.LikeHandlingTest do Object.get_by_ap_id(activity.data["object"]) |> Object.get_emoji_reactions() end + + test "it works for likes with wrong content" do + user = insert(:user) + + {:ok, activity} = CommonAPI.post(user, %{status: "hello"}) + + data = + File.read!("test/fixtures/mitra-custom-emoji-like.json") + |> Jason.decode!() + |> Map.put("object", activity.data["object"]) + |> Map.put("content", 1) + + _actor = insert(:user, ap_id: data["actor"], local: false) + + assert {:error, _} = Transmogrifier.handle_incoming(data) + end end