mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-17 07:23:21 +01:00
Show preview on edit member label screen.
This commit is contained in:
committed by
Cody Henthorne
parent
a3fce4c149
commit
a8a6fec19d
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user