summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-04-13 08:29:25 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2024-04-17 20:59:41 +0200
commit4317031296d3c13925c9309db98a96a2a660372a (patch)
tree46326913b635348f3caeb430b5c23411e689d341
parent22b7ce9d3d1ba91a2e7f5be1ecfe38d295c1d193 (diff)
(test) Chatroom metadata updates
-rw-r--r--chatroom.test24
1 files changed, 23 insertions, 1 deletions
diff --git a/chatroom.test b/chatroom.test
index 89cf18a..ac66f38 100644
--- a/chatroom.test
+++ b/chatroom.test
@@ -9,12 +9,16 @@ test ChatroomSetup:
send "chatroom-create second"
send "chatroom-list-local"
- expect /chatroom-list-item [a-z0-9#]+ first/
+
+ expect /chatroom-list-item ([a-z0-9#]+) first/ capture first
expect /chatroom-list-item [a-z0-9#]+ second/
local:
expect /chatroom-list-(.*)/ capture done
guard (done == "done")
+ expect /chatroom-create-done ([a-z0-9#]+) first.*/ from p1 capture first
+ expect /chatroom-create-done ([a-z0-9#]+) second.*/ from p1 capture second
+
# Send chatrooms to new peers
spawn as p2
@@ -46,8 +50,26 @@ test ChatroomSetup:
send "chatroom-create third" to p1
send "chatroom-create fourth" to p2
send "chatroom-create fifth" to p3
+
+ expect /chatroom-create-done ([a-z0-9#]+) fourth.*/ from p2 capture fourth
+ expect /chatroom-create-done ([a-z0-9#]+) fifth.*/ from p3 capture fifth
+
for p in [ p1, p2, p3 ]:
with p:
expect /chatroom-watched-added [a-z0-9#]+ third/
expect /chatroom-watched-added [a-z0-9#]+ fourth/
expect /chatroom-watched-added [a-z0-9#]+ fifth/
+
+ # Update chatroom name
+
+ send "chatroom-set-name $first first2" to p1
+ for p in [ p1, p2, p3 ]:
+ with p:
+ expect /chatroom-watched-updated [a-z0-9#]+ first2.*/
+
+ send "chatroom-set-name $fourth fourth2" to p2
+ send "chatroom-set-name $fifth fifth2" to p3
+ for p in [ p1, p2, p3 ]:
+ with p:
+ expect /chatroom-watched-updated [a-z0-9#]+ fourth2.*/
+ expect /chatroom-watched-updated [a-z0-9#]+ fifth2.*/