mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 23:21:59 +01:00
song added sort, robust scroll reset, restyled search and filter controls
This commit is contained in:
@@ -111,6 +111,28 @@ class LibraryDaoTest {
|
||||
assertEquals(listOf("Beta"), dao.albumsByName(sourceId, starredFilter = 2, search = "").page().map { it.name })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun songAddedSortOrdersByCreated() =
|
||||
runTest {
|
||||
val sourceId = source()
|
||||
val dao = db.libraryDao()
|
||||
dao.upsertSongs(
|
||||
listOf(
|
||||
song(sourceId, "s1", "Zebra", starred = null, created = 100),
|
||||
song(sourceId, "s2", "Apple", starred = null, created = 200),
|
||||
),
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
listOf("Apple", "Zebra"),
|
||||
dao.songsByAdded(sourceId, starredFilter = 0, search = "").page().map { it.song.title },
|
||||
)
|
||||
assertEquals(
|
||||
listOf("Zebra", "Apple"),
|
||||
dao.songsByAddedReversed(sourceId, starredFilter = 0, search = "").page().map { it.song.title },
|
||||
)
|
||||
}
|
||||
|
||||
private suspend fun source(): Long =
|
||||
db.sourcesDao().insertSource(Source(name = "Navidrome", address = "http://localhost", isActive = true, createdAt = 0))
|
||||
|
||||
@@ -149,6 +171,7 @@ class LibraryDaoTest {
|
||||
id: String,
|
||||
title: String,
|
||||
starred: Long?,
|
||||
created: Long = 0,
|
||||
) = Song(
|
||||
sourceId = sourceId,
|
||||
id = id,
|
||||
@@ -162,5 +185,6 @@ class LibraryDaoTest {
|
||||
disc = 1,
|
||||
starred = starred,
|
||||
genre = null,
|
||||
created = created,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ class LibraryOptionsTest {
|
||||
composeRule.waitForIdle()
|
||||
assertEquals(StarredFilter.Starred, query.starred)
|
||||
|
||||
composeRule.onNodeWithText("Clear filters").performClick()
|
||||
composeRule.onNodeWithContentDescription("Clear filters").performClick()
|
||||
composeRule.waitForIdle()
|
||||
assertEquals(StarredFilter.Any, query.starred)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user