summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2024-01-13 22:23:21 +0000
committertusooa <tusooa@kazv.moe>2024-01-13 22:23:21 +0000
commitd3a4f5b7d7234efddc7fed608f6062b30e8a4c11 (patch)
treef7ad12e961971087ee1be3f288723709d8b2bc0e /test
parent9cc46c55382d2e8960016b52f72ad63b0e55dd16 (diff)
parent7651198508cc40adfab27969f196e4496bd441da (diff)
Merge branch 'nil-contentMap' into 'develop'
Support objects with a nil contentMap (firefish) Closes #3231 See merge request pleroma/pleroma!4030
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs
index 9750fa25f..2507fa2b0 100644
--- a/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs
+++ b/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs
@@ -221,6 +221,19 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do
"<p><span class=\"h-card\"><a href=\"http://localtesting.pleroma.lol/users/lain\" class=\"u-url mention\">@<span>lain</span></a></span></p>"
end
+ test "it works for incoming notices with a nil contentMap (firefish)" do
+ data =
+ File.read!("test/fixtures/mastodon-post-activity-contentmap.json")
+ |> Jason.decode!()
+ |> Map.put("contentMap", nil)
+
+ {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
+ object = Object.normalize(data["object"], fetch: false)
+
+ assert object.data["content"] ==
+ "<p><span class=\"h-card\"><a href=\"http://localtesting.pleroma.lol/users/lain\" class=\"u-url mention\">@<span>lain</span></a></span></p>"
+ end
+
test "it works for incoming notices with to/cc not being an array (kroeg)" do
data = File.read!("test/fixtures/kroeg-post-activity.json") |> Jason.decode!()