mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 12:56:06 +00:00
fix(library): only list the Collections source when it has something to show
This commit is contained in:
2 files changed
+7
-7
No files matched your search
@@ -44,11 +44,11 @@ class SoundtrackCollectionsTest {
|
||||
@Test fun emptyFavoritesCanBeLeftOutOfTheLibraryList() {
|
||||
val context = androidx.test.core.app.ApplicationProvider.getApplicationContext<android.content.Context>()
|
||||
SoundtrackCollections.load(context)
|
||||
SoundtrackCollections.create(context, "Chill", emptyList())
|
||||
val ids = { skip: Boolean -> SoundtrackCollections.games(context, "Favorites", skip).map { it.appId } }
|
||||
assertTrue(SoundtrackCollections.FAVORITES_ID in ids(false))
|
||||
assertFalse(SoundtrackCollections.FAVORITES_ID in ids(true))
|
||||
SoundtrackCollections.add(context, SoundtrackCollections.FAVORITES_ID, listOf(ref("a")))
|
||||
assertTrue(SoundtrackCollections.FAVORITES_ID in ids(true))
|
||||
val custom = SoundtrackCollections.create(context, "Chill", emptyList())!!
|
||||
val favorites = SoundtrackCollections.FAVORITES_ID
|
||||
assertEquals(listOf(custom), SoundtrackCollections.games(context, "Favorites", skipEmptyFavorites = true).map { it.appId })
|
||||
assertEquals(listOf(favorites, custom), SoundtrackCollections.games(context, "Favorites").map { it.appId })
|
||||
SoundtrackCollections.add(context, favorites, listOf(ref("a")))
|
||||
assertEquals(listOf(favorites, custom), SoundtrackCollections.games(context, "Favorites", skipEmptyFavorites = true).map { it.appId })
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user