From 3bdfb505b30749d40419e658991b03bf2ca5df1f Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 13 Feb 2024 00:05:37 +0100 Subject: [PATCH] Extract fun to create VideoInfo in test. --- .../timeline/model/InReplyToMetadataKtTest.kt | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/model/InReplyToMetadataKtTest.kt b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/model/InReplyToMetadataKtTest.kt index 11dc75b015..71dda9ff70 100644 --- a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/model/InReplyToMetadataKtTest.kt +++ b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/timeline/model/InReplyToMetadataKtTest.kt @@ -61,6 +61,7 @@ import io.element.android.libraries.matrix.ui.components.AttachmentThumbnailType import kotlinx.coroutines.test.runTest import org.junit.Test import org.junit.runner.RunWith +import kotlin.time.Duration.Companion.minutes @RunWith(AndroidJUnit4::class) class InReplyToMetadataKtTest { @@ -137,16 +138,7 @@ class InReplyToMetadataKtTest { messageType = VideoMessageType( body = "body", source = aMediaSource(), - info = VideoInfo( - duration = null, - height = null, - width = null, - mimetype = null, - size = null, - thumbnailInfo = null, - thumbnailSource = aMediaSource(), - blurhash = A_BLUR_HASH - ), + info = aVideoInfo(), ) ) ).metadata() @@ -447,6 +439,19 @@ fun anInReplyToDetails( textContent = textContent, ) +fun aVideoInfo(): VideoInfo { + return VideoInfo( + duration = 1.minutes, + height = 100, + width = 100, + mimetype = "video/mp4", + size = 1000, + thumbnailInfo = null, + thumbnailSource = aMediaSource(), + blurhash = A_BLUR_HASH, + ) +} + fun anImageInfo(): ImageInfo { return ImageInfo( height = 100,