Skip to content

Commit

Permalink
add a test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Nov 1, 2023
1 parent 1cb8318 commit 5a813ec
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -750,4 +750,27 @@ class ConversationTest {

assertTrue(isBobAllowed2)
}

@Test
fun testImplicitConsentWhenSendingAMessage() {
val bobConversation = bobClient.conversations.newConversation(alice.walletAddress, null)
val isAllowed = bobConversation.consentState() == ConsentState.ALLOWED

// Conversations you start should start as allowed
assertTrue(isAllowed)

val aliceConversation = aliceClient.conversations.list()[0]
val isUnknown = aliceConversation.consentState() == ConsentState.UNKNOWN

// Conversations you receive should start as unknown
assertTrue(isUnknown)

aliceConversation.send(content = "hey bob")
aliceClient.contacts.refreshConsentList()
val isNowAllowed = aliceConversation.consentState() == ConsentState.ALLOWED

// Conversations you send a message to get marked as allowed
assertTrue(isNowAllowed)

}
}

0 comments on commit 5a813ec

Please sign in to comment.