diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-06-14 22:25:04 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-07-15 11:39:54 +0200 |
commit | 10bd08ef07bd91995589ad37cb25e6889dac59b3 (patch) | |
tree | fd37d2f19fe8cdfdd188ddc30d37a3dbdb28019b /test | |
parent | 89a2433154b05c378f9c5b3224375049f3dbc8af (diff) | |
download | pleroma-10bd08ef07bd91995589ad37cb25e6889dac59b3.tar.gz |
transmogrifier_test: test date, anyOf and oneOf completely
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/transmogrifier_test.exs | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 73949b558..4184b93ce 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -224,14 +224,33 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do object = Object.normalize(activity, false) - assert Enum.all?(object.data["oneOf"], fn choice -> - choice["name"] in [ - "Dunno", - "Everyone knows that!", - "25 char limit is dumb", - "I can't even fit a funny" - ] - end) + assert object.data["closed"] == "2019-05-11T09:03:36Z" + + assert object.data["anyOf"] == [] + + assert Enum.sort(object.data["oneOf"]) == + Enum.sort([ + %{ + "name" => "25 char limit is dumb", + "replies" => %{"totalItems" => 0, "type" => "Collection"}, + "type" => "Note" + }, + %{ + "name" => "Dunno", + "replies" => %{"totalItems" => 0, "type" => "Collection"}, + "type" => "Note" + }, + %{ + "name" => "Everyone knows that!", + "replies" => %{"totalItems" => 1, "type" => "Collection"}, + "type" => "Note" + }, + %{ + "name" => "I can't even fit a funny", + "replies" => %{"totalItems" => 1, "type" => "Collection"}, + "type" => "Note" + } + ]) end test "it works for incoming listens" do |