Release v0.2.37
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package com.ponzischeme89.memby.ui.genre
|
||||
|
||||
import com.ponzischeme89.memby.data.model.BaseItem
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class GenreBrowseTest {
|
||||
@@ -11,12 +14,48 @@ class GenreBrowseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `genre picker trims deduplicates and sorts names`() {
|
||||
fun `genre tabs have a stable product order`() {
|
||||
assertEquals(
|
||||
listOf("Action", "comedy", "Science Fiction"),
|
||||
normaliseGenres(
|
||||
listOf(" Science Fiction ", "comedy", "", "Action", "Comedy", " "),
|
||||
listOf(
|
||||
"All Movies",
|
||||
"Action & Adventure",
|
||||
"Comedy",
|
||||
"Crime",
|
||||
"Drama",
|
||||
"Horror",
|
||||
"Mystery",
|
||||
"Sci-Fi & Fantasy",
|
||||
"Thriller",
|
||||
"War & History",
|
||||
),
|
||||
genreCategoryTabs("Movie").take(10).map(GenreCategory::label),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `neighbouring raw genres merge into one Emby filter`() {
|
||||
assertEquals("Action|Adventure", genreCategory("Movie", "action-adventure").filter)
|
||||
assertEquals(
|
||||
"Science Fiction|Sci-Fi|Sci Fi|Fantasy",
|
||||
genreCategory("Series", "sci-fi-fantasy").filter,
|
||||
)
|
||||
assertEquals("War|History", genreCategory("Movie", "war-history").filter)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `series keeps the same core tabs and adds reality`() {
|
||||
assertEquals(
|
||||
genreCategories("Movie").map(GenreCategory::id),
|
||||
genreCategories("Series").dropLast(1).map(GenreCategory::id),
|
||||
)
|
||||
assertEquals("reality", genreCategories("Series").last().id)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `favourite overrides update a paged card copy immediately`() {
|
||||
val item = BaseItem(id = "film", name = "Film", type = "Movie")
|
||||
assertFalse(item.isFavorite)
|
||||
assertTrue(item.withFavourite(true).isFavorite)
|
||||
assertFalse(item.withFavourite(true).withFavourite(false).isFavorite)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user