summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHélène <pleroma-dev@helene.moe>2022-08-19 02:45:49 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2022-11-27 04:54:19 +0100
commit542bb1725866304232a1a80b1afeea6c8f2e8fc7 (patch)
tree8ff8a673f5dcb8bf819708265eb948027eee4a6b /test
parent747311f623190cac9e345e1db3568ed850495ac2 (diff)
downloadpleroma-542bb1725866304232a1a80b1afeea6c8f2e8fc7.tar.gz
pleroma-542bb1725866304232a1a80b1afeea6c8f2e8fc7.zip
ArticleNotePageValidator: fix replies fixing
Some software, like GoToSocial, expose replies as ActivityPub Collections, but do not expose any item array directly in the object, causing validation to fail via the ObjectID validator. Now, Pleroma will drop that field in this situation too.
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs
index 720c17d8d..917009912 100644
--- a/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs
+++ b/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs
@@ -32,4 +32,17 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest
%{valid?: true} = ArticleNotePageValidator.cast_and_validate(note)
end
end
+
+ test "a Note without replies/first/items validates" do
+ insert(:user, ap_id: "https://mastodon.social/users/emelie")
+
+ note =
+ "test/fixtures/tesla_mock/status.emelie.json"
+ |> File.read!()
+ |> Jason.decode!()
+ |> pop_in(["replies", "first", "items"])
+ |> elem(1)
+
+ %{valid?: true} = ArticleNotePageValidator.cast_and_validate(note)
+ end
end