commit: 5a3b81d92ef532769a11d4374424665f6d97a08f
parent 4ebfc011fc5cb24dab9aa187372579ebbadb6cd2
Author: Lain Soykaf <lain@lain.com>
Date: Mon, 27 Nov 2023 17:55:16 +0400
ActivityPub.UtilsTest: Add failing test for strip_report_status_data
Diffstat:
1 file changed, 31 insertions(+), 0 deletions(-)
diff --git a/test/pleroma/web/activity_pub/utils_test.exs b/test/pleroma/web/activity_pub/utils_test.exs
@@ -16,6 +16,37 @@ defmodule Pleroma.Web.ActivityPub.UtilsTest do
require Pleroma.Constants
+ describe "strip_report_status_data/1" do
+ test "does not break on issues with the reported activites" do
+ reporter = insert(:user)
+ target_account = insert(:user)
+ {:ok, activity} = CommonAPI.post(target_account, %{status: "foobar"})
+ context = Utils.generate_context_id()
+ content = "foobar"
+
+ res =
+ Utils.make_flag_data(
+ %{
+ actor: reporter,
+ context: context,
+ account: target_account,
+ statuses: [%{"id" => activity.data["id"]}],
+ content: content
+ },
+ %{}
+ )
+
+ res =
+ res
+ |> Map.put("object", res["object"] ++ [nil, 1, 5, "123"])
+
+ {:ok, activity} = Pleroma.Web.ActivityPub.ActivityPub.insert(res)
+
+ Utils.strip_report_status_data(activity)
+ |> IO.inspect()
+ end
+ end
+
describe "fetch the latest Follow" do
test "fetches the latest Follow activity" do
%Activity{data: %{"type" => "Follow"}} = activity = insert(:follow_activity)