aboutsummaryrefslogtreecommitdiff
path: root/test/pleroma
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2022-08-27 17:51:41 -0400
committerTusooa Zhu <tusooa@kazv.moe>2022-08-27 17:51:41 -0400
commit3afa1903ee202cc0acb4170bc06c491c15875145 (patch)
tree37d59e2d36d9295c2bad389342de2431be1b32d7 /test/pleroma
parenta022b9d73340f0fcf2bc74fb60de6324a1da0b12 (diff)
downloadpleroma-3afa1903ee202cc0acb4170bc06c491c15875145.tar.gz
Do not stream out Create of ChatMessage
Diffstat (limited to 'test/pleroma')
-rw-r--r--test/pleroma/activity/ir/topics_test.exs23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/pleroma/activity/ir/topics_test.exs b/test/pleroma/activity/ir/topics_test.exs
index 311f85dea..0abda60b0 100644
--- a/test/pleroma/activity/ir/topics_test.exs
+++ b/test/pleroma/activity/ir/topics_test.exs
@@ -13,6 +13,29 @@ defmodule Pleroma.Activity.Ir.TopicsTest do
import Mock
+ describe "chat message" do
+ test "Create produces no topics" do
+ activity = %Activity{
+ object: %Object{data: %{"type" => "ChatMessage"}},
+ data: %{"type" => "Create"}
+ }
+
+ assert [] == Topics.get_activity_topics(activity)
+ end
+
+ test "Delete produces user and user:pleroma_chat" do
+ activity = %Activity{
+ object: %Object{data: %{"type" => "ChatMessage"}},
+ data: %{"type" => "Delete"}
+ }
+
+ topics = Topics.get_activity_topics(activity)
+ assert [_, _] = topics
+ assert "user" in topics
+ assert "user:pleroma_chat" in topics
+ end
+ end
+
describe "poll answer" do
test "produce no topics" do
activity = %Activity{object: %Object{data: %{"type" => "Answer"}}}