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 @@ defmodule Pleroma.Web.ApiSpec.SubscriptionOperation do
allOf: [BooleanLike],
nullable: true,
description: "Receive chat notifications?"
},
"pleroma:emoji_reaction": %Schema{
allOf: [BooleanLike],
nullable: true,
description: "Receive emoji reaction notifications?"
}
}
}

View File

@ -59,7 +59,12 @@ defmodule Pleroma.Web.MastodonAPI.SubscriptionControllerTest do
conn
|> post("/api/v1/push/subscription", %{
"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
})
@ -68,7 +73,11 @@ defmodule Pleroma.Web.MastodonAPI.SubscriptionControllerTest do
[subscription] = Pleroma.Repo.all(Subscription)
assert %{
"alerts" => %{"mention" => true, "pleroma:chat_mention" => true},
"alerts" => %{
"mention" => true,
"pleroma:chat_mention" => true,
"pleroma:emoji_reaction" => true
},
"endpoint" => subscription.endpoint,
"id" => to_string(subscription.id),
"server_key" => @server_key