Skip to content

Commit

Permalink
fix up the tests a bit'
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jan 30, 2024
1 parent 2c7ac43 commit 5c15d7b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ dependencies {
implementation 'org.web3j:crypto:5.0.0'
implementation "net.java.dev.jna:jna:5.13.0@aar"
api 'com.google.protobuf:protobuf-kotlin-lite:3.22.3'
api 'org.xmtp:proto-kotlin:3.31.0'
api 'org.xmtp:proto-kotlin:3.38.0'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'app.cash.turbine:turbine:0.12.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ class GroupMembershipChangeTest {
fun testCanAddMembers() {
Client.register(codec = GroupMembershipChangeCodec())

val group = alixClient.conversations.newGroup(listOf(bo.walletAddress, caro.walletAddress))
val group = alixClient.conversations.newGroup(
listOf(
bo.walletAddress.lowercase(),
caro.walletAddress.lowercase()
)
)
val messages = group.messages()
assertEquals(messages.size, 1)
val content: GroupMembershipChanges? = messages.first().content()
Expand All @@ -69,10 +74,15 @@ class GroupMembershipChangeTest {
fun testCanRemoveMembers() {
Client.register(codec = GroupMembershipChangeCodec())

val group = alixClient.conversations.newGroup(listOf(bo.walletAddress, caro.walletAddress))
val group = alixClient.conversations.newGroup(
listOf(
bo.walletAddress.lowercase(),
caro.walletAddress.lowercase()
)
)
val messages = group.messages()
assertEquals(messages.size, 1)
group.removeMembers(listOf(caro.walletAddress))
group.removeMembers(listOf(caro.walletAddress.lowercase()))
assertEquals(messages.size, 2)
val content: GroupMembershipChanges? = messages.first().content()
assertEquals(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,11 @@ class GroupTest {
val group = boClient.conversations.newGroup(listOf(alix.walletAddress.lowercase()))
group.send("howdy")
group.send("gm")
runBlocking { group.sync() }
assertEquals(group.messages().first().body, "howdy")
assertEquals(group.messages().size, 2)
assertEquals(group.messages().first().body, "gm")
assertEquals(group.messages().size, 3)

val sameGroup = alixClient.conversations.listGroups().last()
assertEquals(sameGroup.messages().size, 2)
assertEquals(sameGroup.messages().first().body, "howdy")
assertEquals(sameGroup.messages().first().body, "gm")
}
}

0 comments on commit 5c15d7b

Please sign in to comment.