mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 17:27:45 +00:00
Updated tests
This commit is contained in:
parent
7b7c053d18
commit
c3cf2b8d03
@ -295,7 +295,7 @@ class ConversationViewModel(
|
||||
* - We are dealing with a contact from a community (blinded recipient) that does not allow
|
||||
* requests form community members
|
||||
*/
|
||||
private fun shouldHideInputBar(): Boolean = openGroup?.canWrite == false ||
|
||||
fun shouldHideInputBar(): Boolean = openGroup?.canWrite == false ||
|
||||
blindedRecipient?.blocksCommunityMessageRequests == true
|
||||
|
||||
fun legacyBannerRecipient(context: Context): Recipient? = recipient?.run {
|
||||
|
@ -203,7 +203,7 @@ class ConversationViewModelTest: BaseViewModelTest() {
|
||||
@Test
|
||||
fun `local recipient should have input and no blinded recipient`() {
|
||||
whenever(recipient.isLocalNumber).thenReturn(true)
|
||||
assertThat(viewModel.uiState.value.hideInputBar, equalTo(false))
|
||||
assertThat(viewModel.shouldHideInputBar(), equalTo(false))
|
||||
assertThat(viewModel.blindedRecipient, nullValue())
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ class ConversationViewModelTest: BaseViewModelTest() {
|
||||
}
|
||||
whenever(repository.maybeGetBlindedRecipient(recipient)).thenReturn(blinded)
|
||||
assertThat(viewModel.blindedRecipient, notNullValue())
|
||||
assertThat(viewModel.uiState.value.hideInputBar, equalTo(true))
|
||||
assertThat(viewModel.shouldHideInputBar(), equalTo(true))
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user