TagValidator: Add test for Link tag

This commit is contained in:
silverpill 2022-12-29 23:57:19 +00:00
commit 45646ff52c
2 changed files with 42 additions and 0 deletions

View file

@ -123,6 +123,22 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
assert activity.data["context"] == object.data["context"]
end
# https://codeberg.org/fediverse/fep/src/branch/main/feps/fep-e232.md
test "it accepts FEP-e232 link tags" do
insert(:user, ap_id: "https://example.org/users/alice")
message = File.read!("test/fixtures/fep-e232.json") |> Jason.decode!()
assert {:ok, activity} = Transmogrifier.handle_incoming(message)
object = Object.normalize(activity)
assert length(object.data["tag"]) == 1
tag = object.data["tag"] |> List.first()
assert tag["type"] == "Link"
assert tag["name"] == "https://example.org/objects/9"
end
end
describe "prepare outgoing" do