Skip to content

Commit

Permalink
add test for last message
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jan 17, 2025
1 parent d89c4c8 commit 71e37a8
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,30 @@ class ReadReceiptTest {
Client.register(codec = ReadReceiptCodec())

val fixtures = fixtures()
val aliceClient = fixtures.alixClient
val aliceConversation = runBlocking {
aliceClient.conversations.newConversation(fixtures.bo.walletAddress)
val alixClient = fixtures.alixClient
val alixConversation = runBlocking {
alixClient.conversations.newConversation(fixtures.bo.walletAddress)
}

runBlocking { aliceConversation.send(text = "hey alice 2 bob") }
runBlocking { alixConversation.send(text = "hey alice 2 bob") }

val readReceipt = ReadReceipt

runBlocking {
aliceConversation.send(
alixConversation.send(
content = readReceipt,
options = SendOptions(contentType = ContentTypeReadReceipt),
)
}
val messages = runBlocking { aliceConversation.messages() }
val messages = runBlocking { alixConversation.messages() }
assertEquals(messages.size, 2)
if (messages.size == 2) {
val contentType: String = messages.first().encodedContent.type.typeId
assertEquals(contentType, "readReceipt")
}
assertEquals(
runBlocking { alixConversation.lastMessage() }!!.encodedContent.type.typeId,
"text"
)
}
}

0 comments on commit 71e37a8

Please sign in to comment.