Skip to content

Commit

Permalink
fix up and write tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Sep 26, 2024
1 parent 2b0532c commit 5827b9e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,14 @@ class ClientTest {
}

var state = runBlocking { alixClient3.inboxState(true) }
assertEquals(state.installationIds.size, 3)
assertEquals(state.installations.size, 3)
assert(state.installations.first().createdAt != null)

runBlocking {
alixClient3.revokeAllOtherInstallations(alixWallet)
}

state = runBlocking { alixClient3.inboxState(true) }
assertEquals(state.installationIds.size, 1)
assertEquals(state.installations.size, 1)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class GroupTest {
)

assertEquals(
Conversation.Group(group).peerAddresses.sorted(),
Conversation.Group(group).peerAddresses().sorted(),
listOf(
caroClient.inboxId,
alixClient.inboxId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ class GroupUpdatedTest {
}
val messages = group.messages()
assertEquals(messages.size, 1)
assertEquals(group.members().size, 3)
assertEquals(runBlocking { group.members().size }, 3)
runBlocking { group.removeMembers(listOf(caro.walletAddress)) }
val updatedMessages = group.messages()
assertEquals(updatedMessages.size, 2)
assertEquals(group.members().size, 2)
assertEquals(runBlocking { group.members().size }, 2)
val content: GroupUpdated? = updatedMessages.first().content()

assertEquals(
Expand All @@ -119,7 +119,7 @@ class GroupUpdatedTest {
}
val messages = group.messages()
assertEquals(messages.size, 1)
assertEquals(group.members().size, 3)
assertEquals(runBlocking { group.members().size }, 3)
runBlocking {
group.send(
content = membershipChange,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class V3ClientTest {
fun testsCanCreateGroup() {
val group = runBlocking { boV3Client.conversations.newGroup(listOf(caroV2V3.walletAddress)) }
assertEquals(
group.members().map { it.inboxId }.sorted(),
runBlocking { group.members().map { it.inboxId }.sorted() },
listOf(caroV2V3Client.inboxId, boV3Client.inboxId).sorted()
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ sealed class Conversation {
* @return [TopicData] that contains all the information about the Topic, the conversation
* context and the necessary encryption data for it.
*/
suspend fun toTopicData(): TopicData {
fun toTopicData(): TopicData {
val data = TopicData.newBuilder()
.setCreatedNs(createdAt.time * 1_000_000)
.setPeerAddress(peerAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ class Installation(private val ffiInstallation: FfiInstallation) {
get() = ffiInstallation.clientTimestampNs?.let {
Date(it.toLong())
}
}
}

0 comments on commit 5827b9e

Please sign in to comment.