Update OpenAPI spec/schema and test to verify support for pleroma:emoji_reaction subscriptions

This commit is contained in:
Mark Felder 2020-11-17 19:15:11 +00:00
parent 80e21903d4
commit 67a6abd071
2 changed files with 16 additions and 2 deletions

View File

@ -146,6 +146,11 @@ defp create_request do
allOf: [BooleanLike], allOf: [BooleanLike],
nullable: true, nullable: true,
description: "Receive chat notifications?" description: "Receive chat notifications?"
},
"pleroma:emoji_reaction": %Schema{
allOf: [BooleanLike],
nullable: true,
description: "Receive emoji reaction notifications?"
} }
} }
} }

View File

@ -59,7 +59,12 @@ test "successful creation", %{conn: conn} do
conn conn
|> post("/api/v1/push/subscription", %{ |> post("/api/v1/push/subscription", %{
"data" => %{ "data" => %{
"alerts" => %{"mention" => true, "test" => true, "pleroma:chat_mention" => true} "alerts" => %{
"mention" => true,
"test" => true,
"pleroma:chat_mention" => true,
"pleroma:emoji_reaction" => true
}
}, },
"subscription" => @sub "subscription" => @sub
}) })
@ -68,7 +73,11 @@ test "successful creation", %{conn: conn} do
[subscription] = Pleroma.Repo.all(Subscription) [subscription] = Pleroma.Repo.all(Subscription)
assert %{ assert %{
"alerts" => %{"mention" => true, "pleroma:chat_mention" => true}, "alerts" => %{
"mention" => true,
"pleroma:chat_mention" => true,
"pleroma:emoji_reaction" => true
},
"endpoint" => subscription.endpoint, "endpoint" => subscription.endpoint,
"id" => to_string(subscription.id), "id" => to_string(subscription.id),
"server_key" => @server_key "server_key" => @server_key