Skip to content

Commit 50b9ad3

Browse files
committed
fix: adds tests for group allowance and consent
1 parent 3d4280e commit 50b9ad3

File tree

1 file changed

+13
-0
lines changed
  • library/src/androidTest/java/org/xmtp/android/library

1 file changed

+13
-0
lines changed

library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt

+13
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ class GroupTest {
9999
assert(boGroup.id.isNotEmpty())
100100
assert(alixGroup.id.isNotEmpty())
101101

102+
assertEquals(boClient.contacts.consentList.groupState(boGroup.id), ConsentState.ALLOWED)
103+
assertEquals(alixClient.contacts.consentList.groupState(alixGroup.id), ConsentState.UNKNOWN)
104+
102105
boGroup.addMembers(listOf(caro.walletAddress))
103106
runBlocking { alixGroup.sync() }
104107
assertEquals(alixGroup.memberAddresses().size, 3)
@@ -263,6 +266,16 @@ class GroupTest {
263266
}
264267
}
265268

269+
@Test
270+
fun testGroupStartsWithAllowedState() {
271+
val group = boClient.conversations.newGroup(listOf(alix.walletAddress))
272+
group.send("howdy")
273+
group.send("gm")
274+
runBlocking { group.sync() }
275+
assert(boClient.contacts.isGroupAllowed(group.id))
276+
assertEquals(boClient.contacts.consentList.groupState(group.id), ConsentState.ALLOWED)
277+
}
278+
266279
@Test
267280
fun testCanSendMessageToGroup() {
268281
val group = boClient.conversations.newGroup(listOf(alix.walletAddress))

0 commit comments

Comments
 (0)