@@ -79,6 +79,13 @@ class GroupTest {
79
79
runBlocking { alixGroup.sync() }
80
80
assertEquals(alixGroup.memberAddresses().size, 3 )
81
81
assertEquals(boGroup.memberAddresses().size, 3 )
82
+
83
+ assertEquals(boGroup.permissionLevel(), GroupPermissions .EVERYONE_IS_ADMIN )
84
+ assertEquals(alixGroup.permissionLevel(), GroupPermissions .EVERYONE_IS_ADMIN )
85
+ assertEquals(boGroup.adminAddress().lowercase(), boClient.address.lowercase())
86
+ assertEquals(alixGroup.adminAddress().lowercase(), boClient.address.lowercase())
87
+ assert (boGroup.isAdmin())
88
+ assert (! alixGroup.isAdmin())
82
89
}
83
90
84
91
@Test
@@ -115,6 +122,13 @@ class GroupTest {
115
122
runBlocking { boGroup.sync() }
116
123
assertEquals(alixGroup.memberAddresses().size, 2 )
117
124
assertEquals(boGroup.memberAddresses().size, 2 )
125
+
126
+ assertEquals(boGroup.permissionLevel(), GroupPermissions .GROUP_CREATOR_IS_ADMIN )
127
+ assertEquals(alixGroup.permissionLevel(), GroupPermissions .GROUP_CREATOR_IS_ADMIN )
128
+ assertEquals(boGroup.adminAddress().lowercase(), boClient.address.lowercase())
129
+ assertEquals(alixGroup.adminAddress().lowercase(), boClient.address.lowercase())
130
+ assert (boGroup.isAdmin())
131
+ assert (! alixGroup.isAdmin())
118
132
}
119
133
120
134
@Test
@@ -306,6 +320,31 @@ class GroupTest {
306
320
}
307
321
}
308
322
323
+ @Test
324
+ fun testCanStreamAllGroupMessages () = kotlinx.coroutines.test.runTest {
325
+ val group = caroClient.conversations.newGroup(listOf (alix.walletAddress))
326
+ alixClient.conversations.syncGroups()
327
+ alixClient.conversations.streamAllGroupMessages().test {
328
+ group.send(" hi" )
329
+ assertEquals(" hi" , awaitItem().encodedContent.content.toStringUtf8())
330
+ group.send(" hi again" )
331
+ assertEquals(" hi again" , awaitItem().encodedContent.content.toStringUtf8())
332
+ }
333
+ }
334
+
335
+ @Test
336
+ fun testCanStreamAllMessages () = kotlinx.coroutines.test.runTest {
337
+ val group = caroClient.conversations.newGroup(listOf (alix.walletAddress))
338
+ val conversation = boClient.conversations.newConversation(alix.walletAddress)
339
+ alixClient.conversations.syncGroups()
340
+ alixClient.conversations.streamAllMessages(includeGroups = true ).test {
341
+ group.send(" hi" )
342
+ assertEquals(" hi" , awaitItem().encodedContent.content.toStringUtf8())
343
+ conversation.send(" hi again" )
344
+ assertEquals(" hi again" , awaitItem().encodedContent.content.toStringUtf8())
345
+ }
346
+ }
347
+
309
348
@Test
310
349
fun testCanStreamDecryptedGroupMessages () = kotlinx.coroutines.test.runTest {
311
350
val group = boClient.conversations.newGroup(listOf (alix.walletAddress))
@@ -319,6 +358,31 @@ class GroupTest {
319
358
}
320
359
}
321
360
361
+ @Test
362
+ fun testCanStreamAllDecryptedGroupMessages () = kotlinx.coroutines.test.runTest {
363
+ val group = caroClient.conversations.newGroup(listOf (alix.walletAddress))
364
+ alixClient.conversations.syncGroups()
365
+ alixClient.conversations.streamAllGroupDecryptedMessages().test {
366
+ group.send(" hi" )
367
+ assertEquals(" hi" , awaitItem().encodedContent.content.toStringUtf8())
368
+ group.send(" hi again" )
369
+ assertEquals(" hi again" , awaitItem().encodedContent.content.toStringUtf8())
370
+ }
371
+ }
372
+
373
+ @Test
374
+ fun testCanStreamAllDecryptedMessages () = kotlinx.coroutines.test.runTest {
375
+ val group = caroClient.conversations.newGroup(listOf (alix.walletAddress))
376
+ val conversation = boClient.conversations.newConversation(alix.walletAddress)
377
+ alixClient.conversations.syncGroups()
378
+ alixClient.conversations.streamAllDecryptedMessages(includeGroups = true ).test {
379
+ group.send(" hi" )
380
+ assertEquals(" hi" , awaitItem().encodedContent.content.toStringUtf8())
381
+ conversation.send(" hi again" )
382
+ assertEquals(" hi again" , awaitItem().encodedContent.content.toStringUtf8())
383
+ }
384
+ }
385
+
322
386
@Test
323
387
fun testCanStreamGroups () = kotlinx.coroutines.test.runTest {
324
388
boClient.conversations.streamGroups().test {
0 commit comments