Show preview on edit member label screen.

This commit is contained in:
jeffrey-signal
2026-02-24 10:46:39 -05:00
committed by Cody Henthorne
parent a3fce4c149
commit a8a6fec19d
9 changed files with 314 additions and 62 deletions

View File

@@ -13,8 +13,10 @@ import kotlinx.coroutines.test.UnconfinedTestDispatcher
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.thoughtcrime.securesms.conversation.colors.NameColor
import org.thoughtcrime.securesms.groups.GroupId
import org.thoughtcrime.securesms.recipients.RecipientId
import org.thoughtcrime.securesms.testing.CoroutineDispatcherRule
@@ -30,6 +32,12 @@ class MemberLabelViewModelTest {
private val groupId = mockk<GroupId.V2>()
private val recipientId = RecipientId.from(1L)
@Before
fun setUp() {
coEvery { memberLabelRepo.getRecipient(any()) } returns mockk(relaxed = true)
coEvery { memberLabelRepo.getSenderNameColor(any(), any()) } returns NameColor(0, 0)
}
@Test
fun `isSaveEnabled returns true when label text is different from the original value`() {
coEvery { memberLabelRepo.getLabel(groupId, any<RecipientId>()) } returns MemberLabel(emoji = null, text = "Original")