Update OpenAPI spec/schema and test to verify support for pleroma:emoji_reaction...
authorMark Felder <feld@FreeBSD.org>
Tue, 17 Nov 2020 19:15:11 +0000 (19:15 +0000)
committerMark Felder <feld@FreeBSD.org>
Tue, 17 Nov 2020 20:20:00 +0000 (20:20 +0000)
lib/pleroma/web/api_spec/operations/subscription_operation.ex
test/pleroma/web/mastodon_api/controllers/subscription_controller_test.exs

index 775dd795de3a05cfac95b927232145f4dbe87c71..77e70005b6f53a35b02affa437fbc481cbd58603 100644 (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?"
                 }
               }
             }
index d36bb1ae8f75beb1202d820eab5c97afcc1f1760..6e9369b3fdb2fee46fe03e2248b0d054c8be3bc2 100644 (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