Fix avatar loading in OS views when app is not running.

This commit is contained in:
Cody Henthorne
2024-08-19 14:10:20 -04:00
committed by mtang-signal
parent 8a4d9fc635
commit 71b5a9f865
22 changed files with 384 additions and 439 deletions

View File

@@ -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