Fix tests.
This commit is contained in:
parent
96fac67b58
commit
47f0aba3be
5 changed files with 69 additions and 54 deletions
|
|
@ -31,12 +31,15 @@ import io.element.android.libraries.push.impl.notifications.fixtures.aSimpleNoti
|
||||||
import io.element.android.libraries.push.impl.notifications.fixtures.anInviteNotifiableEvent
|
import io.element.android.libraries.push.impl.notifications.fixtures.anInviteNotifiableEvent
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
import org.robolectric.RobolectricTestRunner
|
||||||
|
|
||||||
private val MY_AVATAR_URL: String? = null
|
private val MY_AVATAR_URL: String? = null
|
||||||
private val AN_INVITATION_EVENT = anInviteNotifiableEvent(roomId = A_ROOM_ID)
|
private val AN_INVITATION_EVENT = anInviteNotifiableEvent(roomId = A_ROOM_ID)
|
||||||
private val A_SIMPLE_EVENT = aSimpleNotifiableEvent(eventId = AN_EVENT_ID)
|
private val A_SIMPLE_EVENT = aSimpleNotifiableEvent(eventId = AN_EVENT_ID)
|
||||||
private val A_MESSAGE_EVENT = aNotifiableMessageEvent(eventId = AN_EVENT_ID, roomId = A_ROOM_ID)
|
private val A_MESSAGE_EVENT = aNotifiableMessageEvent(eventId = AN_EVENT_ID, roomId = A_ROOM_ID)
|
||||||
|
|
||||||
|
@RunWith(RobolectricTestRunner::class)
|
||||||
class NotificationFactoryTest {
|
class NotificationFactoryTest {
|
||||||
|
|
||||||
private val androidNotificationFactory = FakeAndroidNotificationFactory()
|
private val androidNotificationFactory = FakeAndroidNotificationFactory()
|
||||||
|
|
@ -131,12 +134,14 @@ class NotificationFactoryTest {
|
||||||
)
|
)
|
||||||
val roomWithMessage = mapOf(A_ROOM_ID to listOf(ProcessedEvent(ProcessedEvent.Type.KEEP, A_MESSAGE_EVENT)))
|
val roomWithMessage = mapOf(A_ROOM_ID to listOf(ProcessedEvent(ProcessedEvent.Type.KEEP, A_MESSAGE_EVENT)))
|
||||||
|
|
||||||
|
val fakeImageLoader = FakeImageLoader()
|
||||||
val result = roomWithMessage.toNotifications(
|
val result = roomWithMessage.toNotifications(
|
||||||
currentUser = MatrixUser(A_SESSION_ID, A_SESSION_ID.value, MY_AVATAR_URL),
|
currentUser = MatrixUser(A_SESSION_ID, A_SESSION_ID.value, MY_AVATAR_URL),
|
||||||
imageLoader = FakeImageLoader(),
|
imageLoader = fakeImageLoader.getImageLoader(),
|
||||||
)
|
)
|
||||||
|
|
||||||
assertThat(result).isEqualTo(listOf(expectedNotification))
|
assertThat(result).isEqualTo(listOf(expectedNotification))
|
||||||
|
assertThat(fakeImageLoader.getCoilRequests().size).isEqualTo(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -144,9 +149,10 @@ class NotificationFactoryTest {
|
||||||
val events = listOf(ProcessedEvent(ProcessedEvent.Type.REMOVE, A_MESSAGE_EVENT))
|
val events = listOf(ProcessedEvent(ProcessedEvent.Type.REMOVE, A_MESSAGE_EVENT))
|
||||||
val emptyRoom = mapOf(A_ROOM_ID to events)
|
val emptyRoom = mapOf(A_ROOM_ID to events)
|
||||||
|
|
||||||
|
val fakeImageLoader = FakeImageLoader()
|
||||||
val result = emptyRoom.toNotifications(
|
val result = emptyRoom.toNotifications(
|
||||||
currentUser = MatrixUser(A_SESSION_ID, A_SESSION_ID.value, MY_AVATAR_URL),
|
currentUser = MatrixUser(A_SESSION_ID, A_SESSION_ID.value, MY_AVATAR_URL),
|
||||||
imageLoader = FakeImageLoader(),
|
imageLoader = fakeImageLoader.getImageLoader(),
|
||||||
)
|
)
|
||||||
|
|
||||||
assertThat(result).isEqualTo(
|
assertThat(result).isEqualTo(
|
||||||
|
|
@ -156,15 +162,17 @@ class NotificationFactoryTest {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
assertThat(fakeImageLoader.getCoilRequests().size).isEqualTo(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `given a room with only redacted events when mapping to notification then is Empty`() = testWith(notificationFactory) {
|
fun `given a room with only redacted events when mapping to notification then is Empty`() = testWith(notificationFactory) {
|
||||||
val redactedRoom = mapOf(A_ROOM_ID to listOf(ProcessedEvent(ProcessedEvent.Type.KEEP, A_MESSAGE_EVENT.copy(isRedacted = true))))
|
val redactedRoom = mapOf(A_ROOM_ID to listOf(ProcessedEvent(ProcessedEvent.Type.KEEP, A_MESSAGE_EVENT.copy(isRedacted = true))))
|
||||||
|
|
||||||
|
val fakeImageLoader = FakeImageLoader()
|
||||||
val result = redactedRoom.toNotifications(
|
val result = redactedRoom.toNotifications(
|
||||||
currentUser = MatrixUser(A_SESSION_ID, A_SESSION_ID.value, MY_AVATAR_URL),
|
currentUser = MatrixUser(A_SESSION_ID, A_SESSION_ID.value, MY_AVATAR_URL),
|
||||||
imageLoader = FakeImageLoader(),
|
imageLoader = fakeImageLoader.getImageLoader(),
|
||||||
)
|
)
|
||||||
|
|
||||||
assertThat(result).isEqualTo(
|
assertThat(result).isEqualTo(
|
||||||
|
|
@ -174,6 +182,7 @@ class NotificationFactoryTest {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
assertThat(fakeImageLoader.getCoilRequests().size).isEqualTo(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -193,12 +202,14 @@ class NotificationFactoryTest {
|
||||||
A_ROOM_ID,
|
A_ROOM_ID,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val fakeImageLoader = FakeImageLoader()
|
||||||
val result = roomWithRedactedMessage.toNotifications(
|
val result = roomWithRedactedMessage.toNotifications(
|
||||||
currentUser = MatrixUser(A_SESSION_ID, A_SESSION_ID.value, MY_AVATAR_URL),
|
currentUser = MatrixUser(A_SESSION_ID, A_SESSION_ID.value, MY_AVATAR_URL),
|
||||||
imageLoader = FakeImageLoader(),
|
imageLoader = fakeImageLoader.getImageLoader(),
|
||||||
)
|
)
|
||||||
|
|
||||||
assertThat(result).isEqualTo(listOf(expectedNotification))
|
assertThat(result).isEqualTo(listOf(expectedNotification))
|
||||||
|
assertThat(fakeImageLoader.getCoilRequests().size).isEqualTo(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ import io.element.android.libraries.push.impl.notifications.model.NotifiableEven
|
||||||
import io.mockk.mockk
|
import io.mockk.mockk
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
import org.robolectric.RobolectricTestRunner
|
||||||
|
|
||||||
private const val MY_USER_DISPLAY_NAME = "display-name"
|
private const val MY_USER_DISPLAY_NAME = "display-name"
|
||||||
private const val MY_USER_AVATAR_URL = "avatar-url"
|
private const val MY_USER_AVATAR_URL = "avatar-url"
|
||||||
|
|
@ -43,6 +45,7 @@ private val MESSAGE_META = RoomNotification.Message.Meta(
|
||||||
)
|
)
|
||||||
private val ONE_SHOT_META = OneShotNotification.Append.Meta(key = "ignored", summaryLine = "ignored", isNoisy = false, timestamp = -1)
|
private val ONE_SHOT_META = OneShotNotification.Append.Meta(key = "ignored", summaryLine = "ignored", isNoisy = false, timestamp = -1)
|
||||||
|
|
||||||
|
@RunWith(RobolectricTestRunner::class)
|
||||||
class NotificationRendererTest {
|
class NotificationRendererTest {
|
||||||
|
|
||||||
private val notificationDisplayer = FakeNotificationDisplayer()
|
private val notificationDisplayer = FakeNotificationDisplayer()
|
||||||
|
|
@ -199,7 +202,7 @@ class NotificationRendererTest {
|
||||||
MatrixUser(A_SESSION_ID, MY_USER_DISPLAY_NAME, MY_USER_AVATAR_URL),
|
MatrixUser(A_SESSION_ID, MY_USER_DISPLAY_NAME, MY_USER_AVATAR_URL),
|
||||||
useCompleteNotificationFormat = USE_COMPLETE_NOTIFICATION_FORMAT,
|
useCompleteNotificationFormat = USE_COMPLETE_NOTIFICATION_FORMAT,
|
||||||
eventsToProcess = AN_EVENT_LIST,
|
eventsToProcess = AN_EVENT_LIST,
|
||||||
imageLoader = FakeImageLoader(),
|
imageLoader = FakeImageLoader().getImageLoader(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,8 @@
|
||||||
package io.element.android.libraries.push.impl.notifications
|
package io.element.android.libraries.push.impl.notifications
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
|
||||||
import android.graphics.drawable.ColorDrawable
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import coil.Coil
|
|
||||||
import coil.ImageLoader
|
|
||||||
import coil.annotation.ExperimentalCoilApi
|
import coil.annotation.ExperimentalCoilApi
|
||||||
import coil.test.FakeImageLoaderEngine
|
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import io.element.android.libraries.matrix.api.media.MediaSource
|
import io.element.android.libraries.matrix.api.media.MediaSource
|
||||||
import io.element.android.libraries.matrix.test.A_ROOM_ID
|
import io.element.android.libraries.matrix.test.A_ROOM_ID
|
||||||
|
|
@ -51,6 +46,7 @@ class RoomGroupMessageCreatorTest {
|
||||||
@Test
|
@Test
|
||||||
fun `test createRoomMessage with one Event`() = runTest {
|
fun `test createRoomMessage with one Event`() = runTest {
|
||||||
val sut = createRoomGroupMessageCreator()
|
val sut = createRoomGroupMessageCreator()
|
||||||
|
val fakeImageLoader = FakeImageLoader()
|
||||||
val result = sut.createRoomMessage(
|
val result = sut.createRoomMessage(
|
||||||
currentUser = aMatrixUser(),
|
currentUser = aMatrixUser(),
|
||||||
events = listOf(
|
events = listOf(
|
||||||
|
|
@ -59,7 +55,7 @@ class RoomGroupMessageCreatorTest {
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
roomId = A_ROOM_ID,
|
roomId = A_ROOM_ID,
|
||||||
imageLoader = FakeImageLoader(),
|
imageLoader = fakeImageLoader.getImageLoader(),
|
||||||
)
|
)
|
||||||
val resultMetaWithoutFormatting = result.meta.copy(
|
val resultMetaWithoutFormatting = result.meta.copy(
|
||||||
summaryLine = result.meta.summaryLine.toString()
|
summaryLine = result.meta.summaryLine.toString()
|
||||||
|
|
@ -73,11 +69,13 @@ class RoomGroupMessageCreatorTest {
|
||||||
shouldBing = false,
|
shouldBing = false,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
assertThat(fakeImageLoader.getCoilRequests().size).isEqualTo(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `test createRoomMessage with one noisy Event`() = runTest {
|
fun `test createRoomMessage with one noisy Event`() = runTest {
|
||||||
val sut = createRoomGroupMessageCreator()
|
val sut = createRoomGroupMessageCreator()
|
||||||
|
val fakeImageLoader = FakeImageLoader()
|
||||||
val result = sut.createRoomMessage(
|
val result = sut.createRoomMessage(
|
||||||
currentUser = aMatrixUser(),
|
currentUser = aMatrixUser(),
|
||||||
events = listOf(
|
events = listOf(
|
||||||
|
|
@ -86,7 +84,7 @@ class RoomGroupMessageCreatorTest {
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
roomId = A_ROOM_ID,
|
roomId = A_ROOM_ID,
|
||||||
imageLoader = FakeImageLoader(),
|
imageLoader = fakeImageLoader.getImageLoader(),
|
||||||
)
|
)
|
||||||
val resultMetaWithoutFormatting = result.meta.copy(
|
val resultMetaWithoutFormatting = result.meta.copy(
|
||||||
summaryLine = result.meta.summaryLine.toString()
|
summaryLine = result.meta.summaryLine.toString()
|
||||||
|
|
@ -100,6 +98,7 @@ class RoomGroupMessageCreatorTest {
|
||||||
shouldBing = true,
|
shouldBing = true,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
assertThat(fakeImageLoader.getCoilRequests().size).isEqualTo(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -144,20 +143,7 @@ class RoomGroupMessageCreatorTest {
|
||||||
api: Int,
|
api: Int,
|
||||||
expectedCoilRequests: List<Any>,
|
expectedCoilRequests: List<Any>,
|
||||||
) = runTest {
|
) = runTest {
|
||||||
val coilRequests = mutableListOf<Any>()
|
val fakeImageLoader = FakeImageLoader()
|
||||||
val engine = FakeImageLoaderEngine.Builder()
|
|
||||||
.intercept(
|
|
||||||
predicate = {
|
|
||||||
coilRequests.add(it)
|
|
||||||
true
|
|
||||||
},
|
|
||||||
drawable = ColorDrawable(Color.BLUE)
|
|
||||||
)
|
|
||||||
.build()
|
|
||||||
val imageLoader = ImageLoader.Builder(RuntimeEnvironment.getApplication())
|
|
||||||
.components { add(engine) }
|
|
||||||
.build()
|
|
||||||
Coil.setImageLoader(imageLoader)
|
|
||||||
val sut = createRoomGroupMessageCreator(
|
val sut = createRoomGroupMessageCreator(
|
||||||
sdkIntProvider = FakeBuildVersionSdkIntProvider(api)
|
sdkIntProvider = FakeBuildVersionSdkIntProvider(api)
|
||||||
)
|
)
|
||||||
|
|
@ -173,7 +159,7 @@ class RoomGroupMessageCreatorTest {
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
roomId = A_ROOM_ID,
|
roomId = A_ROOM_ID,
|
||||||
imageLoader = imageLoader,
|
imageLoader = fakeImageLoader.getImageLoader(),
|
||||||
)
|
)
|
||||||
val resultMetaWithoutFormatting = result.meta.copy(
|
val resultMetaWithoutFormatting = result.meta.copy(
|
||||||
summaryLine = result.meta.summaryLine.toString()
|
summaryLine = result.meta.summaryLine.toString()
|
||||||
|
|
@ -187,12 +173,13 @@ class RoomGroupMessageCreatorTest {
|
||||||
shouldBing = false,
|
shouldBing = false,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
assertThat(coilRequests.toList()).isEqualTo(expectedCoilRequests)
|
assertThat(fakeImageLoader.getCoilRequests()).isEqualTo(expectedCoilRequests)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `test createRoomMessage with two Events`() = runTest {
|
fun `test createRoomMessage with two Events`() = runTest {
|
||||||
val sut = createRoomGroupMessageCreator()
|
val sut = createRoomGroupMessageCreator()
|
||||||
|
val fakeImageLoader = FakeImageLoader()
|
||||||
val result = sut.createRoomMessage(
|
val result = sut.createRoomMessage(
|
||||||
currentUser = aMatrixUser(),
|
currentUser = aMatrixUser(),
|
||||||
events = listOf(
|
events = listOf(
|
||||||
|
|
@ -200,7 +187,7 @@ class RoomGroupMessageCreatorTest {
|
||||||
aNotifiableMessageEvent(timestamp = A_TIMESTAMP + 10),
|
aNotifiableMessageEvent(timestamp = A_TIMESTAMP + 10),
|
||||||
),
|
),
|
||||||
roomId = A_ROOM_ID,
|
roomId = A_ROOM_ID,
|
||||||
imageLoader = FakeImageLoader(),
|
imageLoader = fakeImageLoader.getImageLoader(),
|
||||||
)
|
)
|
||||||
val resultMetaWithoutFormatting = result.meta.copy(
|
val resultMetaWithoutFormatting = result.meta.copy(
|
||||||
summaryLine = result.meta.summaryLine.toString()
|
summaryLine = result.meta.summaryLine.toString()
|
||||||
|
|
@ -214,11 +201,13 @@ class RoomGroupMessageCreatorTest {
|
||||||
shouldBing = false,
|
shouldBing = false,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
assertThat(fakeImageLoader.getCoilRequests().size).isEqualTo(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `test createRoomMessage with smart reply error`() = runTest {
|
fun `test createRoomMessage with smart reply error`() = runTest {
|
||||||
val sut = createRoomGroupMessageCreator()
|
val sut = createRoomGroupMessageCreator()
|
||||||
|
val fakeImageLoader = FakeImageLoader()
|
||||||
val result = sut.createRoomMessage(
|
val result = sut.createRoomMessage(
|
||||||
currentUser = aMatrixUser(),
|
currentUser = aMatrixUser(),
|
||||||
events = listOf(
|
events = listOf(
|
||||||
|
|
@ -228,7 +217,7 @@ class RoomGroupMessageCreatorTest {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
roomId = A_ROOM_ID,
|
roomId = A_ROOM_ID,
|
||||||
imageLoader = FakeImageLoader(),
|
imageLoader = fakeImageLoader.getImageLoader(),
|
||||||
)
|
)
|
||||||
val resultMetaWithoutFormatting = result.meta.copy(
|
val resultMetaWithoutFormatting = result.meta.copy(
|
||||||
summaryLine = result.meta.summaryLine.toString()
|
summaryLine = result.meta.summaryLine.toString()
|
||||||
|
|
@ -242,11 +231,13 @@ class RoomGroupMessageCreatorTest {
|
||||||
shouldBing = false,
|
shouldBing = false,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
assertThat(fakeImageLoader.getCoilRequests().size).isEqualTo(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `test createRoomMessage for direct room`() = runTest {
|
fun `test createRoomMessage for direct room`() = runTest {
|
||||||
val sut = createRoomGroupMessageCreator()
|
val sut = createRoomGroupMessageCreator()
|
||||||
|
val fakeImageLoader = FakeImageLoader()
|
||||||
val result = sut.createRoomMessage(
|
val result = sut.createRoomMessage(
|
||||||
currentUser = aMatrixUser(),
|
currentUser = aMatrixUser(),
|
||||||
events = listOf(
|
events = listOf(
|
||||||
|
|
@ -255,7 +246,7 @@ class RoomGroupMessageCreatorTest {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
roomId = A_ROOM_ID,
|
roomId = A_ROOM_ID,
|
||||||
imageLoader = FakeImageLoader(),
|
imageLoader = fakeImageLoader.getImageLoader(),
|
||||||
)
|
)
|
||||||
val resultMetaWithoutFormatting = result.meta.copy(
|
val resultMetaWithoutFormatting = result.meta.copy(
|
||||||
summaryLine = result.meta.summaryLine.toString()
|
summaryLine = result.meta.summaryLine.toString()
|
||||||
|
|
@ -269,6 +260,7 @@ class RoomGroupMessageCreatorTest {
|
||||||
shouldBing = false,
|
shouldBing = false,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
assertThat(fakeImageLoader.getCoilRequests().size).isEqualTo(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,32 +16,40 @@
|
||||||
|
|
||||||
package io.element.android.libraries.push.impl.notifications.fake
|
package io.element.android.libraries.push.impl.notifications.fake
|
||||||
|
|
||||||
import coil.ComponentRegistry
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.ColorDrawable
|
||||||
import coil.ImageLoader
|
import coil.ImageLoader
|
||||||
import coil.disk.DiskCache
|
import coil.annotation.ExperimentalCoilApi
|
||||||
import coil.memory.MemoryCache
|
import coil.test.FakeImageLoaderEngine
|
||||||
import coil.request.DefaultRequestOptions
|
import org.robolectric.RuntimeEnvironment
|
||||||
import coil.request.Disposable
|
|
||||||
import coil.request.ImageRequest
|
|
||||||
import coil.request.ImageResult
|
|
||||||
|
|
||||||
class FakeImageLoader : ImageLoader {
|
@OptIn(ExperimentalCoilApi::class)
|
||||||
override val components: ComponentRegistry = error("Fake class")
|
class FakeImageLoader {
|
||||||
override val defaults: DefaultRequestOptions = error("Fake class")
|
private val coilRequests = mutableListOf<Any>()
|
||||||
override val diskCache: DiskCache? = null
|
|
||||||
override val memoryCache: MemoryCache? = null
|
|
||||||
|
|
||||||
override fun enqueue(request: ImageRequest): Disposable {
|
private var cache: ImageLoader? = null
|
||||||
error("Fake class")
|
|
||||||
|
fun getImageLoader(): ImageLoader {
|
||||||
|
return cache ?: ImageLoader.Builder(RuntimeEnvironment.getApplication())
|
||||||
|
.components {
|
||||||
|
val engine = FakeImageLoaderEngine.Builder()
|
||||||
|
.intercept(
|
||||||
|
predicate = {
|
||||||
|
coilRequests.add(it)
|
||||||
|
true
|
||||||
|
},
|
||||||
|
drawable = ColorDrawable(Color.BLUE)
|
||||||
|
)
|
||||||
|
.build()
|
||||||
|
add(engine)
|
||||||
|
}
|
||||||
|
.build()
|
||||||
|
.also {
|
||||||
|
cache = it
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun execute(request: ImageRequest): ImageResult {
|
fun getCoilRequests(): List<Any> {
|
||||||
error("Fake class")
|
return coilRequests.toList()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun newBuilder(): ImageLoader.Builder {
|
|
||||||
error("Fake class")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun shutdown() = Unit
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ import io.element.android.libraries.matrix.api.MatrixClient
|
||||||
import io.element.android.libraries.matrix.ui.media.ImageLoaderHolder
|
import io.element.android.libraries.matrix.ui.media.ImageLoaderHolder
|
||||||
|
|
||||||
class FakeImageLoaderHolder : ImageLoaderHolder {
|
class FakeImageLoaderHolder : ImageLoaderHolder {
|
||||||
|
private val fakeImageLoader = FakeImageLoader()
|
||||||
override fun get(client: MatrixClient): ImageLoader {
|
override fun get(client: MatrixClient): ImageLoader {
|
||||||
return FakeImageLoader()
|
return fakeImageLoader.getImageLoader()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue