From 71e37a81b757c4f19ffb3b9ba84106dee2733c3d Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Thu, 16 Jan 2025 20:47:37 -0800 Subject: [PATCH] add test for last message --- .../org/xmtp/android/library/ReadReceiptTest.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/library/src/androidTest/java/org/xmtp/android/library/ReadReceiptTest.kt b/library/src/androidTest/java/org/xmtp/android/library/ReadReceiptTest.kt index a3941457f..b7b862165 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/ReadReceiptTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/ReadReceiptTest.kt @@ -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" + ) } }