Update bundled pleroma-fe to c4fcdc71
[akkoma] / test / integration / mastodon_websocket_test.exs
index 2e385f5adbacb3070063c9e121f4af439f82b8e8..a604713d800ec83407049116282c78a49ad733b3 100644 (file)
@@ -7,9 +7,9 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do
 
   import Pleroma.Factory
 
+  alias Pleroma.Integration.WebsocketClient
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.OAuth
-  alias Pleroma.Integration.WebsocketClient
   alias Pleroma.Web.Streamer
 
   @path Pleroma.Web.Endpoint.url()
@@ -80,7 +80,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do
         Pleroma.Repo.insert(
           OAuth.App.register_changeset(%OAuth.App{}, %{
             client_name: "client",
-            scopes: "scope",
+            scopes: ["scope"],
             redirect_uris: "url"
           })
         )
@@ -97,5 +97,15 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do
     test "accepts valid tokens", state do
       assert {:ok, _} = start_socket("?stream=user&access_token=#{state.token.token}")
     end
+
+    test "accepts the 'user' stream", %{token: token} = _state do
+      assert {:ok, _} = start_socket("?stream=user&access_token=#{token.token}")
+      assert {:error, {403, "Forbidden"}} = start_socket("?stream=user")
+    end
+
+    test "accepts the 'user:notification' stream", %{token: token} = _state do
+      assert {:ok, _} = start_socket("?stream=user:notification&access_token=#{token.token}")
+      assert {:error, {403, "Forbidden"}} = start_socket("?stream=user:notification")
+    end
   end
 end