diff options
author | Hélène <pleroma-dev@helene.moe> | 2022-08-19 02:45:49 +0200 |
---|---|---|
committer | Hélène <pleroma-dev@helene.moe> | 2022-08-19 02:45:49 +0200 |
commit | 4661b56720b4f70eb6996bf975c4d88db9828006 (patch) | |
tree | 4193d36e3242349aefc47958afd3579da41d306e /test/pleroma | |
parent | 61254111e59f02118cad15de49d1e0704c07030e (diff) | |
download | pleroma-4661b56720b4f70eb6996bf975c4d88db9828006.tar.gz |
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/pleroma')
-rw-r--r-- | test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs | 13 |
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 e59bf6787..2dd1361ea 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 @@ -54,4 +54,17 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest %{valid?: true} = ArticleNotePageValidator.cast_and_validate(note) 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 |