summaryrefslogtreecommitdiff
path: root/test/polyjuice
diff options
context:
space:
mode:
authorArjan Scherpenisse <arjan@scherpenisse.net>2021-02-19 13:03:24 +0100
committerArjan Scherpenisse <arjan@scherpenisse.net>2021-02-20 09:08:56 +0100
commita946555b69a584f74455e5124d4d2597bc5114c7 (patch)
tree92895ec3228fef5a6d80626fc9ccab7a16ec5b42 /test/polyjuice
parentMove defmodule out of client test so each test can be run individually (diff)
Handle ephemeral events (e.g. for typing indicator)
Diffstat (limited to 'test/polyjuice')
-rw-r--r--test/polyjuice/client/sync_test.exs32
1 files changed, 30 insertions, 2 deletions
diff --git a/test/polyjuice/client/sync_test.exs b/test/polyjuice/client/sync_test.exs
index 94387aa..5cf2f35 100644
--- a/test/polyjuice/client/sync_test.exs
+++ b/test/polyjuice/client/sync_test.exs
@@ -133,6 +133,27 @@ defmodule Polyjuice.Client.SyncTest do
"rooms" => %{
"join" => %{
"!room_id" => %{
+ "ephemeral" => %{
+ "events" => [
+ %{
+ "content" => %{"user_ids" => ["@alice:example.org"]},
+ "type" => "m.typing"
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+
+ "3" ->
+ %{
+ "next_batch" => "4",
+ "presence" => %{},
+ "account_data" => %{},
+ "rooms" => %{
+ "join" => %{
+ "!room_id" => %{
"timeline" => %{
"limited" => false,
"prev_batch" => "p2",
@@ -154,9 +175,9 @@ defmodule Polyjuice.Client.SyncTest do
}
}
- "3" ->
+ "4" ->
%{
- "next_batch" => "4",
+ "next_batch" => "5",
"presence" => %{},
"account_data" => %{},
"rooms" => %{
@@ -294,6 +315,13 @@ defmodule Polyjuice.Client.SyncTest do
)
assert_receive(
+ {:polyjuice_client, :ephemeral,
+ {"!room_id",
+ %{"content" => %{"user_ids" => ["@alice:example.org"]}, "type" => "m.typing"}}},
+ 1000
+ )
+
+ assert_receive(
{:polyjuice_client, :message,
{"!room_id",
%{