diff options
author | tusooa <tusooa@kazv.moe> | 2022-09-05 01:10:34 +0000 |
---|---|---|
committer | tusooa <tusooa@kazv.moe> | 2022-09-05 01:10:34 +0000 |
commit | f8afba95b20670b5d6e93896ccd27bb3fca003a2 (patch) | |
tree | f338acc1d4c9a3eb18e0686c98830d2aa5a47f85 /test/pleroma | |
parent | 20347898e22d10f377cd35f21407555dbac53bbf (diff) | |
parent | 4661b56720b4f70eb6996bf975c4d88db9828006 (diff) | |
download | pleroma-f8afba95b20670b5d6e93896ccd27bb3fca003a2.tar.gz |
Merge branch 'fix/gts-federation' into 'develop'
GoToSocial federation fixes
See merge request pleroma/pleroma!3725
Diffstat (limited to 'test/pleroma')
-rw-r--r-- | test/pleroma/signature_test.exs | 5 | ||||
-rw-r--r-- | test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/pleroma/signature_test.exs b/test/pleroma/signature_test.exs index 92d05f26c..b849cbee7 100644 --- a/test/pleroma/signature_test.exs +++ b/test/pleroma/signature_test.exs @@ -109,6 +109,11 @@ defmodule Pleroma.SignatureTest do {:ok, "https://example.com/users/1234"} end + test "it deduces the actor id for gotoSocial" do + assert Signature.key_id_to_actor_id("https://example.com/users/1234/main-key") == + {:ok, "https://example.com/users/1234"} + end + test "it calls webfinger for 'acct:' accounts" do with_mock(Pleroma.Web.WebFinger, finger: fn _ -> %{"ap_id" => "https://gensokyo.2hu/users/raymoo"} end 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 781093b1d..c7a62be18 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 @@ -103,4 +103,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 |