diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2024-01-11 07:13:13 +0100 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2024-01-11 07:16:45 +0100 |
commit | 7651198508cc40adfab27969f196e4496bd441da (patch) | |
tree | 0b63605313c189074f57dca1af05e636698b93f6 /test | |
parent | 67a5542a73a8fab8c79da21022877bc233e8a760 (diff) |
Support objects with a nil contentMap (firefish)
Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/3231
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs | 13 |
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!() |