Upgrade AndroidX dependencies (#3169)
* upgrade AndroidX dependencies * use new @Upsert in InstanceDao * fix crash because of new Room nullchecks * make TimelineStatusEntity.reblogAccount a val as well
This commit is contained in:
parent
16df2bfe87
commit
006f0de05c
7 changed files with 34 additions and 57 deletions
|
@ -193,9 +193,9 @@ class CachedTimelineRemoteMediatorTest {
|
|||
listOf(
|
||||
mockStatusEntityWithAccount("8"),
|
||||
mockStatusEntityWithAccount("7"),
|
||||
TimelineStatusWithAccount().apply {
|
||||
TimelineStatusWithAccount(
|
||||
status = Placeholder("5", loading = false).toEntity(1)
|
||||
},
|
||||
),
|
||||
mockStatusEntityWithAccount("3"),
|
||||
mockStatusEntityWithAccount("2"),
|
||||
mockStatusEntityWithAccount("1"),
|
||||
|
@ -547,8 +547,8 @@ class CachedTimelineRemoteMediatorTest {
|
|||
private fun AppDatabase.insert(statuses: List<TimelineStatusWithAccount>) {
|
||||
runBlocking {
|
||||
statuses.forEach { statusWithAccount ->
|
||||
if (!statusWithAccount.status.isPlaceholder) {
|
||||
timelineDao().insertAccount(statusWithAccount.account)
|
||||
statusWithAccount.account?.let { account ->
|
||||
timelineDao().insertAccount(account)
|
||||
}
|
||||
statusWithAccount.reblogAccount?.let { account ->
|
||||
timelineDao().insertAccount(account)
|
||||
|
|
|
@ -92,26 +92,26 @@ fun mockStatusEntityWithAccount(
|
|||
val mockedStatus = mockStatus(id)
|
||||
val gson = Gson()
|
||||
|
||||
return TimelineStatusWithAccount().apply {
|
||||
return TimelineStatusWithAccount(
|
||||
status = mockedStatus.toEntity(
|
||||
timelineUserId = userId,
|
||||
gson = gson,
|
||||
expanded = expanded,
|
||||
contentShowing = false,
|
||||
contentCollapsed = true
|
||||
)
|
||||
),
|
||||
account = mockedStatus.account.toEntity(
|
||||
accountId = userId,
|
||||
gson = gson
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun mockPlaceholderEntityWithAccount(
|
||||
id: String,
|
||||
userId: Long = 1,
|
||||
): TimelineStatusWithAccount {
|
||||
return TimelineStatusWithAccount().apply {
|
||||
return TimelineStatusWithAccount(
|
||||
status = Placeholder(id, false).toEntity(userId)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue