Skip to content

Commit

Permalink
remove need to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jan 31, 2024
1 parent 76bfcc7 commit 53c9e26
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class GroupMembershipChangeTest {

val group = alixClient.conversations.newGroup(
listOf(
bo.walletAddress.lowercase(),
caro.walletAddress.lowercase()
bo.walletAddress,
caro.walletAddress
)
)
val messages = group.messages()
Expand All @@ -76,14 +76,14 @@ class GroupMembershipChangeTest {

val group = alixClient.conversations.newGroup(
listOf(
bo.walletAddress.lowercase(),
caro.walletAddress.lowercase()
bo.walletAddress,
caro.walletAddress
)
)
val messages = group.messages()
assertEquals(messages.size, 1)
assertEquals(group.memberAddresses().size, 3)
group.removeMembers(listOf(caro.walletAddress.lowercase()))
group.removeMembers(listOf(caro.walletAddress))
assertEquals(group.messages().size, 2)
assertEquals(group.memberAddresses().size, 2)
val content: GroupMembershipChanges? = messages.first().content()
Expand All @@ -98,8 +98,8 @@ class GroupMembershipChangeTest {
fun testIfNotRegisteredReturnsFallback() {
val group = alixClient.conversations.newGroup(
listOf(
bo.walletAddress.lowercase(),
caro.walletAddress.lowercase()
bo.walletAddress,
caro.walletAddress
)
)
val messages = group.messages()
Expand Down
34 changes: 15 additions & 19 deletions library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ class GroupTest {

@Test
fun testCanCreateAGroup() {
val group = boClient.conversations.newGroup(listOf(alix.walletAddress.lowercase()))
val group = boClient.conversations.newGroup(listOf(alix.walletAddress))
assert(group.id.isNotEmpty())
}

@Test
fun testCanListGroupMembers() {
val group = boClient.conversations.newGroup(
listOf(
alix.walletAddress.lowercase(),
caro.walletAddress.lowercase()
alix.walletAddress,
caro.walletAddress
)
)
assertEquals(
Expand All @@ -80,8 +80,8 @@ class GroupTest {

@Test
fun testCanAddGroupMembers() {
val group = boClient.conversations.newGroup(listOf(alix.walletAddress.lowercase()))
group.addMembers(listOf(caro.walletAddress.lowercase()))
val group = boClient.conversations.newGroup(listOf(alix.walletAddress))
group.addMembers(listOf(caro.walletAddress))
assertEquals(
group.memberAddresses().sorted(),
listOf(
Expand All @@ -96,11 +96,11 @@ class GroupTest {
fun testCanRemoveGroupMembers() {
val group = boClient.conversations.newGroup(
listOf(
alix.walletAddress.lowercase(),
caro.walletAddress.lowercase()
alix.walletAddress,
caro.walletAddress
)
)
group.removeMembers(listOf(caro.walletAddress.lowercase()))
group.removeMembers(listOf(caro.walletAddress))
assertEquals(
group.memberAddresses().sorted(),
listOf(
Expand All @@ -112,28 +112,24 @@ class GroupTest {

@Test
fun testCanListGroups() {
boClient.conversations.newGroup(listOf(alix.walletAddress.lowercase()))
boClient.conversations.newGroup(listOf(caro.walletAddress.lowercase()))
boClient.conversations.newGroup(listOf(alix.walletAddress))
boClient.conversations.newGroup(listOf(caro.walletAddress))
val groups = boClient.conversations.listGroups()
assertEquals(groups.size, 2)
}

@Test
fun testCanListGroupsAndConversations() {
boClient.conversations.newGroup(listOf(alix.walletAddress.lowercase()))
boClient.conversations.newGroup(listOf(caro.walletAddress.lowercase()))
try {
boClient.conversations.newConversation(alix.walletAddress)
} catch (e: Exception) {
boClient.conversations.newConversation(alix.walletAddress.lowercase())
}
boClient.conversations.newGroup(listOf(alix.walletAddress))
boClient.conversations.newGroup(listOf(caro.walletAddress))
boClient.conversations.newConversation(alix.walletAddress)
val convos = boClient.conversations.list(includeGroups = true)
assertEquals(convos.size, 3)
}

@Test
fun testCanSendMessageToGroup() {
val group = boClient.conversations.newGroup(listOf(alix.walletAddress.lowercase()))
val group = boClient.conversations.newGroup(listOf(alix.walletAddress))
group.send("howdy")
group.send("gm")
runBlocking { group.sync() }
Expand All @@ -151,7 +147,7 @@ class GroupTest {
fun testCanSendContentTypesToGroup() {
Client.register(codec = ReactionCodec())

val group = boClient.conversations.newGroup(listOf(alix.walletAddress.lowercase()))
val group = boClient.conversations.newGroup(listOf(alix.walletAddress))
group.send("gm")
runBlocking { group.sync() }
val messageToReact = group.messages()[0]
Expand Down

0 comments on commit 53c9e26

Please sign in to comment.