diff options
| author | Tusooa Zhu <tusooa@kazv.moe> | 2022-08-27 17:51:41 -0400 | 
|---|---|---|
| committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2022-11-27 04:39:32 +0100 | 
| commit | e46c3a0595f007470b8c6eb6bfeed65beb687596 (patch) | |
| tree | b85ddd290cd0f9b13d6fed8ecc22254b0fd47b57 /test | |
| parent | 9b687788874c97def370d94c013bd90952779237 (diff) | |
| download | pleroma-e46c3a0595f007470b8c6eb6bfeed65beb687596.tar.gz pleroma-e46c3a0595f007470b8c6eb6bfeed65beb687596.zip  | |
Do not stream out Create of ChatMessage
Diffstat (limited to 'test')
| -rw-r--r-- | test/pleroma/activity/ir/topics_test.exs | 23 | 
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 9c8e5d932..416c23384 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"}}}  | 
