Additional validation so we don't get caught off guard with a nil response
authorMark Felder <feld@feld.me>
Fri, 12 Feb 2021 19:15:33 +0000 (13:15 -0600)
committerMark Felder <feld@feld.me>
Fri, 12 Feb 2021 19:15:33 +0000 (13:15 -0600)
if CommonAPI ever prevents us from injecting this data

test/pleroma/web/activity_pub/transmogrifier_test.exs

index 2c99875ff249a4bcb9bca72688b9e89ea6345057..33ccbe2a78bb5173e854e4e7cbe2188e856dfe8f 100644 (file)
@@ -208,6 +208,12 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest 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