summary refs log tree commit diff
path: root/tests/handlers
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2015-01-12 18:01:33 +0000
committerPaul "LeoNerd" Evans <paul@matrix.org>2015-01-12 18:01:49 +0000
commit968dc988f9008b15348705c52992100dcabf206f (patch)
tree44f277315e044be384c37fc9a9a182383079862a /tests/handlers
parentSYN-178: Fix off by one. (diff)
downloadsynapse-968dc988f9008b15348705c52992100dcabf206f.tar.xz
Check that setting typing notification still works after explicit timeout - SYN-230
Diffstat (limited to 'tests/handlers')
-rw-r--r--tests/handlers/test_typing.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/handlers/test_typing.py b/tests/handlers/test_typing.py
index 0d4b368a43..6a498b23a4 100644
--- a/tests/handlers/test_typing.py
+++ b/tests/handlers/test_typing.py
@@ -352,3 +352,29 @@ class TypingNotificationsTestCase(unittest.TestCase):
                 }},
             ]
         )
+
+        # SYN-230 - see if we can still set after timeout
+
+        yield self.handler.started_typing(
+            target_user=self.u_apple,
+            auth_user=self.u_apple,
+            room_id=self.room_id,
+            timeout=10000,
+        )
+
+        self.on_new_user_event.assert_has_calls([
+            call(rooms=[self.room_id]),
+        ])
+        self.on_new_user_event.reset_mock()
+
+        self.assertEquals(self.event_source.get_current_key(), 3)
+        self.assertEquals(
+            self.event_source.get_new_events_for_user(self.u_apple, 0, None)[0],
+            [
+                {"type": "m.typing",
+                 "room_id": self.room_id,
+                 "content": {
+                     "user_ids": [self.u_apple.to_string()],
+                }},
+            ]
+        )