From c3cf2b8d035dc529eb6c7ead74c4407240ef365a Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Mon, 16 Sep 2024 09:59:34 +1000 Subject: [PATCH] Updated tests --- .../securesms/conversation/v2/ConversationViewModel.kt | 2 +- .../securesms/conversation/v2/ConversationViewModelTest.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt index 1e995bab01..514dc24ea6 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt @@ -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 { diff --git a/app/src/test/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModelTest.kt b/app/src/test/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModelTest.kt index 936416d922..03b9138249 100644 --- a/app/src/test/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModelTest.kt +++ b/app/src/test/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModelTest.kt @@ -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)) } } \ No newline at end of file