Yokan / rebuild
Course 1 8624561

TrackerLibrarySectionsTest.kt

composeApp/src/commonTest/kotlin/eu/friedcutlet/yokan/ui/screens/activity/TrackerLibrarySectionsTest.kt

test / fixture47 lines
1package eu.friedcutlet.yokan.ui.screens.activity23import eu.friedcutlet.yokan.domain.ItemType4import kotlin.test.Test5import kotlin.test.assertEquals6import kotlin.test.assertTrue78class TrackerLibrarySectionsTest {9    @Test10    fun malMangaSectionsIncludeManhwaAndManhuaTops() {11        val labels = trackerLibrarySections(1, ItemType.Manga).map(TrackerLibrarySectionSpec::label)12        assertEquals(13            listOf("Continue reading", "Popular Manga", "Top Manga", "Top Manhwa", "Top Manhua"),14            labels,15        )16    }1718    @Test19    fun malAnimeSectionsIncludeAiringAndUpcoming() {20        val specs = trackerLibrarySections(1, ItemType.Anime)21        assertEquals(22            listOf("Continue watching", "Airing Anime", "Popular Anime", "Upcoming Anime"),23            specs.map(TrackerLibrarySectionSpec::label),24        )25        assertEquals(listOf(null, "airing", "bypopularity", "upcoming"), specs.map(TrackerLibrarySectionSpec::rankingType))26    }2728    @Test29    fun anilistSectionsCarryLatestReleasingKey() {30        val specs = trackerLibrarySections(2, ItemType.Anime)31        assertEquals("latest", specs.last().rankingType)32        assertEquals(5, specs.size)33    }3435    @Test36    fun simklAndTraktBrowseMoviesAndSeriesPairs() {37        val simkl = trackerLibrarySections(4, ItemType.Manga)38        // Simkl/Trakt ignore the manga/anime cursor entirely.39        assertEquals(simkl, trackerLibrarySections(4, ItemType.Anime))40        assertTrue(simkl.any { it.label == "Trending Movies" && it.isMangaFlag })41        assertTrue(simkl.any { it.label == "Trending Series" && !it.isMangaFlag })4243        val trakt = trackerLibrarySections(5, ItemType.Anime)44        assertEquals(8, trakt.size)45        assertTrue(trakt.any { it.label == "Top Movies (All Time)" && it.rankingType == "favorited/all" })46    }47}48

Search chapters, reference and source filenames.