package eu.friedcutlet.yokan.ui.screens.activity import eu.friedcutlet.yokan.domain.ItemType import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue class TrackerLibrarySectionsTest { @Test fun malMangaSectionsIncludeManhwaAndManhuaTops() { val labels = trackerLibrarySections(1, ItemType.Manga).map(TrackerLibrarySectionSpec::label) assertEquals( listOf("Continue reading", "Popular Manga", "Top Manga", "Top Manhwa", "Top Manhua"), labels, ) } @Test fun malAnimeSectionsIncludeAiringAndUpcoming() { val specs = trackerLibrarySections(1, ItemType.Anime) assertEquals( listOf("Continue watching", "Airing Anime", "Popular Anime", "Upcoming Anime"), specs.map(TrackerLibrarySectionSpec::label), ) assertEquals(listOf(null, "airing", "bypopularity", "upcoming"), specs.map(TrackerLibrarySectionSpec::rankingType)) } @Test fun anilistSectionsCarryLatestReleasingKey() { val specs = trackerLibrarySections(2, ItemType.Anime) assertEquals("latest", specs.last().rankingType) assertEquals(5, specs.size) } @Test fun simklAndTraktBrowseMoviesAndSeriesPairs() { val simkl = trackerLibrarySections(4, ItemType.Manga) // Simkl/Trakt ignore the manga/anime cursor entirely. assertEquals(simkl, trackerLibrarySections(4, ItemType.Anime)) assertTrue(simkl.any { it.label == "Trending Movies" && it.isMangaFlag }) assertTrue(simkl.any { it.label == "Trending Series" && !it.isMangaFlag }) val trakt = trackerLibrarySections(5, ItemType.Anime) assertEquals(8, trakt.size) assertTrue(trakt.any { it.label == "Top Movies (All Time)" && it.rankingType == "favorited/all" }) } }