mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 03:40:56 +01:00
Fix avatar loading in OS views when app is not running.
This commit is contained in:
committed by
mtang-signal
parent
8a4d9fc635
commit
71b5a9f865
@@ -3,6 +3,9 @@ package org.thoughtcrime.securesms.recipients
|
||||
import android.graphics.Color
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
import io.mockk.mockkObject
|
||||
import io.mockk.unmockkAll
|
||||
import org.junit.After
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
@@ -26,19 +29,23 @@ class Recipient_getChatColorsTest : BaseRecipientTest() {
|
||||
|
||||
@Before
|
||||
fun setUp() {
|
||||
wallpaperValues = mockk<WallpaperValues>()
|
||||
chatColorsValues = mockk<ChatColorsValues>()
|
||||
wallpaperValues = mockk()
|
||||
chatColorsValues = mockk()
|
||||
|
||||
val globalWallpaper = createWallpaper(globalWallpaperChatColor)
|
||||
every { wallpaperValues.wallpaper } answers { globalWallpaper }
|
||||
every { chatColorsValues.chatColors } answers { globalChatColor }
|
||||
|
||||
val mockStore = mockk<SignalStore>()
|
||||
SignalStore.testInject(mockStore)
|
||||
mockkObject(SignalStore)
|
||||
every { SignalStore.wallpaper } returns wallpaperValues
|
||||
every { SignalStore.chatColors } returns chatColorsValues
|
||||
}
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
unmockkAll()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Given recipient has custom chat color set, when I getChatColors, then I expect the custom chat color`() {
|
||||
// GIVEN
|
||||
|
||||
Reference in New Issue
Block a user