Skip to content

Commit

Permalink
Cleanup TimelineDaoTest
Browse files Browse the repository at this point in the history
  • Loading branch information
nikclayton committed Nov 25, 2024
1 parent e8eeaea commit 2a43b71
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import app.pachli.core.database.AppDatabase
import app.pachli.core.database.model.TimelineAccountEntity
import app.pachli.core.database.model.TimelineStatusEntity
import app.pachli.core.database.model.TimelineStatusWithAccount
import app.pachli.core.network.model.Card
import app.pachli.core.network.model.Emoji
import app.pachli.core.network.model.PreviewCardKind
import app.pachli.core.network.model.Status
import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
Expand Down Expand Up @@ -332,7 +335,7 @@ class TimelineDaoTest {
displayName = "displayName",
url = "blah",
avatar = "avatar",
emojis = "[\"pachli\": \"http://pachli.cool/emoji.jpg\"]",
emojis = listOf(Emoji("pachli", "http://pachli.cool/emoji.jpg", "", null)),
bot = false,
createdAt = null,
)
Expand All @@ -346,7 +349,7 @@ class TimelineDaoTest {
displayName = "RdisplayName",
url = "Rblah",
avatar = "Ravatar",
emojis = "[]",
emojis = emptyList(),
bot = false,
createdAt = null,
)
Expand All @@ -356,7 +359,7 @@ class TimelineDaoTest {

val card = when (cardUrl) {
null -> null
else -> "{ url: \"$cardUrl\" }"
else -> Card(cardUrl, "", "", PreviewCardKind.LINK, providerName = "", providerUrl = "")
}
val even = accountId % 2 == 0L
val status = TimelineStatusEntity(
Expand All @@ -369,7 +372,7 @@ class TimelineDaoTest {
content = "Content!$statusId",
createdAt = createdAt,
editedAt = null,
emojis = "emojis$statusId",
emojis = emptyList(),
reblogsCount = 1 * statusId.toInt(),
favouritesCount = 2 * statusId.toInt(),
repliesCount = 3 * statusId.toInt(),
Expand All @@ -379,10 +382,10 @@ class TimelineDaoTest {
sensitive = even,
spoilerText = "spoiler$statusId",
visibility = Status.Visibility.PRIVATE,
attachments = "attachments$accountId",
mentions = "mentions$accountId",
tags = "tags$accountId",
application = "application$accountId",
attachments = null,
mentions = null,
tags = null,
application = null,
reblogServerId = if (reblog) (statusId * 100).toString() else null,
reblogAccountId = reblogAuthor?.serverId,
poll = null,
Expand Down

0 comments on commit 2a43b71

Please sign in to comment.