Fix tests

This commit is contained in:
Benoit Marty 2024-11-20 20:01:02 +01:00
parent 4d00f968b7
commit fdf8e49894
2 changed files with 26 additions and 6 deletions

View file

@ -318,6 +318,7 @@ class MessagesPresenterTest {
filename = "image.jpg", filename = "image.jpg",
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = false,
mediaSource = MediaSource(AN_AVATAR_URL), mediaSource = MediaSource(AN_AVATAR_URL),
thumbnailSource = null, thumbnailSource = null,
mimeType = MimeTypes.Jpeg, mimeType = MimeTypes.Jpeg,
@ -359,6 +360,7 @@ class MessagesPresenterTest {
filename = "video.mp4", filename = "video.mp4",
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = false,
duration = 10.milliseconds, duration = 10.milliseconds,
videoSource = MediaSource(AN_AVATAR_URL), videoSource = MediaSource(AN_AVATAR_URL),
thumbnailSource = MediaSource(AN_AVATAR_URL), thumbnailSource = MediaSource(AN_AVATAR_URL),
@ -400,6 +402,7 @@ class MessagesPresenterTest {
content = TimelineItemFileContent( content = TimelineItemFileContent(
filename = "file.pdf", filename = "file.pdf",
caption = null, caption = null,
isEdited = false,
formattedCaption = null, formattedCaption = null,
fileSource = MediaSource(AN_AVATAR_URL), fileSource = MediaSource(AN_AVATAR_URL),
thumbnailSource = MediaSource(AN_AVATAR_URL), thumbnailSource = MediaSource(AN_AVATAR_URL),

View file

@ -237,6 +237,7 @@ class TimelineItemContentMessageFactoryTest {
filename = "filename", filename = "filename",
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = false,
duration = Duration.ZERO, duration = Duration.ZERO,
videoSource = MediaSource(url = "url", json = null), videoSource = MediaSource(url = "url", json = null),
thumbnailSource = null, thumbnailSource = null,
@ -278,7 +279,8 @@ class TimelineItemContentMessageFactoryTest {
thumbnailSource = MediaSource("url_thumbnail"), thumbnailSource = MediaSource("url_thumbnail"),
blurhash = A_BLUR_HASH, blurhash = A_BLUR_HASH,
), ),
) ),
isEdited = true,
), ),
senderDisambiguatedDisplayName = "Bob", senderDisambiguatedDisplayName = "Bob",
eventId = AN_EVENT_ID, eventId = AN_EVENT_ID,
@ -287,6 +289,7 @@ class TimelineItemContentMessageFactoryTest {
filename = "body.mp4", filename = "body.mp4",
caption = "body.mp4 caption", caption = "body.mp4 caption",
formattedCaption = SpannedString("formatted"), formattedCaption = SpannedString("formatted"),
isEdited = true,
duration = 1.minutes, duration = 1.minutes,
videoSource = MediaSource(url = "url", json = null), videoSource = MediaSource(url = "url", json = null),
thumbnailSource = MediaSource("url_thumbnail"), thumbnailSource = MediaSource("url_thumbnail"),
@ -315,6 +318,7 @@ class TimelineItemContentMessageFactoryTest {
filename = "filename", filename = "filename",
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = false,
duration = Duration.ZERO, duration = Duration.ZERO,
mediaSource = MediaSource(url = "url", json = null), mediaSource = MediaSource(url = "url", json = null),
mimeType = MimeTypes.OctetStream, mimeType = MimeTypes.OctetStream,
@ -339,7 +343,8 @@ class TimelineItemContentMessageFactoryTest {
size = 123L, size = 123L,
mimetype = MimeTypes.Mp3, mimetype = MimeTypes.Mp3,
) )
) ),
isEdited = true,
), ),
senderDisambiguatedDisplayName = "Bob", senderDisambiguatedDisplayName = "Bob",
eventId = AN_EVENT_ID, eventId = AN_EVENT_ID,
@ -348,6 +353,7 @@ class TimelineItemContentMessageFactoryTest {
filename = "body.mp3", filename = "body.mp3",
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = true,
duration = 1.minutes, duration = 1.minutes,
mediaSource = MediaSource(url = "url", json = null), mediaSource = MediaSource(url = "url", json = null),
mimeType = MimeTypes.Mp3, mimeType = MimeTypes.Mp3,
@ -370,6 +376,7 @@ class TimelineItemContentMessageFactoryTest {
eventId = AN_EVENT_ID, eventId = AN_EVENT_ID,
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = false,
duration = Duration.ZERO, duration = Duration.ZERO,
mediaSource = MediaSource(url = "url", json = null), mediaSource = MediaSource(url = "url", json = null),
mimeType = MimeTypes.OctetStream, mimeType = MimeTypes.OctetStream,
@ -397,7 +404,8 @@ class TimelineItemContentMessageFactoryTest {
duration = 1.minutes, duration = 1.minutes,
waveform = persistentListOf(1f, 2f), waveform = persistentListOf(1f, 2f),
), ),
) ),
isEdited = true,
), ),
senderDisambiguatedDisplayName = "Bob", senderDisambiguatedDisplayName = "Bob",
eventId = AN_EVENT_ID, eventId = AN_EVENT_ID,
@ -407,6 +415,7 @@ class TimelineItemContentMessageFactoryTest {
filename = "body.ogg", filename = "body.ogg",
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = true,
duration = 1.minutes, duration = 1.minutes,
mediaSource = MediaSource(url = "url", json = null), mediaSource = MediaSource(url = "url", json = null),
mimeType = MimeTypes.Ogg, mimeType = MimeTypes.Ogg,
@ -433,6 +442,7 @@ class TimelineItemContentMessageFactoryTest {
filename = "filename", filename = "filename",
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = false,
duration = Duration.ZERO, duration = Duration.ZERO,
mediaSource = MediaSource(url = "url", json = null), mediaSource = MediaSource(url = "url", json = null),
mimeType = MimeTypes.OctetStream, mimeType = MimeTypes.OctetStream,
@ -454,6 +464,7 @@ class TimelineItemContentMessageFactoryTest {
filename = "filename", filename = "filename",
caption = "body", caption = "body",
formattedCaption = null, formattedCaption = null,
isEdited = false,
mediaSource = MediaSource(url = "url", json = null), mediaSource = MediaSource(url = "url", json = null),
thumbnailSource = null, thumbnailSource = null,
formattedFileSize = "0 Bytes", formattedFileSize = "0 Bytes",
@ -483,6 +494,7 @@ class TimelineItemContentMessageFactoryTest {
filename = "filename", filename = "filename",
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = false,
mediaSource = MediaSource(url = "url", json = null), mediaSource = MediaSource(url = "url", json = null),
thumbnailSource = MediaSource(url = "thumbnail://url", json = null), thumbnailSource = MediaSource(url = "thumbnail://url", json = null),
formattedFileSize = "8192 Bytes", formattedFileSize = "8192 Bytes",
@ -520,15 +532,17 @@ class TimelineItemContentMessageFactoryTest {
thumbnailSource = MediaSource("url_thumbnail"), thumbnailSource = MediaSource("url_thumbnail"),
blurhash = A_BLUR_HASH, blurhash = A_BLUR_HASH,
) )
) ),
isEdited = true,
), ),
senderDisambiguatedDisplayName = "Bob", senderDisambiguatedDisplayName = "Bob",
eventId = AN_EVENT_ID, eventId = AN_EVENT_ID,
) )
val expected = TimelineItemImageContent( val expected = TimelineItemImageContent(
filename = "body.jpg", filename = "body.jpg",
formattedCaption = SpannedString("formatted"),
caption = "body.jpg caption", caption = "body.jpg caption",
formattedCaption = SpannedString("formatted"),
isEdited = true,
mediaSource = MediaSource(url = "url", json = null), mediaSource = MediaSource(url = "url", json = null),
thumbnailSource = MediaSource("url_thumbnail"), thumbnailSource = MediaSource("url_thumbnail"),
formattedFileSize = "888 Bytes", formattedFileSize = "888 Bytes",
@ -556,6 +570,7 @@ class TimelineItemContentMessageFactoryTest {
filename = "filename", filename = "filename",
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = false,
fileSource = MediaSource(url = "url", json = null), fileSource = MediaSource(url = "url", json = null),
thumbnailSource = null, thumbnailSource = null,
formattedFileSize = "0 Bytes", formattedFileSize = "0 Bytes",
@ -586,7 +601,8 @@ class TimelineItemContentMessageFactoryTest {
), ),
thumbnailSource = MediaSource("url_thumbnail"), thumbnailSource = MediaSource("url_thumbnail"),
) )
) ),
isEdited = true,
), ),
senderDisambiguatedDisplayName = "Bob", senderDisambiguatedDisplayName = "Bob",
eventId = AN_EVENT_ID, eventId = AN_EVENT_ID,
@ -595,6 +611,7 @@ class TimelineItemContentMessageFactoryTest {
filename = "body.pdf", filename = "body.pdf",
caption = null, caption = null,
formattedCaption = null, formattedCaption = null,
isEdited = true,
fileSource = MediaSource(url = "url", json = null), fileSource = MediaSource(url = "url", json = null),
thumbnailSource = MediaSource("url_thumbnail"), thumbnailSource = MediaSource("url_thumbnail"),
formattedFileSize = "123 Bytes", formattedFileSize = "123 Bytes",