aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2022-09-05 01:10:34 +0000
committertusooa <tusooa@kazv.moe>2022-09-05 01:10:34 +0000
commitf8afba95b20670b5d6e93896ccd27bb3fca003a2 (patch)
treef338acc1d4c9a3eb18e0686c98830d2aa5a47f85 /test
parent20347898e22d10f377cd35f21407555dbac53bbf (diff)
parent4661b56720b4f70eb6996bf975c4d88db9828006 (diff)
downloadpleroma-f8afba95b20670b5d6e93896ccd27bb3fca003a2.tar.gz
Merge branch 'fix/gts-federation' into 'develop'
GoToSocial federation fixes See merge request pleroma/pleroma!3725
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/signature_test.exs5
-rw-r--r--test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs13
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