From fb2a8e7ccd6cfbfb9bc226998a083405fcebcbe0 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 12 Feb 2021 13:15:33 -0600 Subject: [PATCH] Additional validation so we don't get caught off guard with a nil response if CommonAPI ever prevents us from injecting this data --- test/pleroma/web/activity_pub/transmogrifier_test.exs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/pleroma/web/activity_pub/transmogrifier_test.exs b/test/pleroma/web/activity_pub/transmogrifier_test.exs index 2c99875ff..33ccbe2a7 100644 --- a/test/pleroma/web/activity_pub/transmogrifier_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier_test.exs @@ -208,6 +208,12 @@ test "it strips internal fields" do application: %{name: "TestClient", website: "https://pleroma.social"} }) + # Ensure injected application data made it into the activity + # as we don't have a Token to derive it from, otherwise it will + # be nil and the test will pass + assert %{"application" => %{name: "TestClient", website: "https://pleroma.social"}} = + activity.object.data + {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data) assert length(modified["object"]["tag"]) == 2