mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-15 00:34:12 -05:00
Fix tests (#2049)
* Fix test setup * Fix tests * Disable broken CloudflareTest * Add a basic test for Android's Looper
This commit is contained in:
@@ -18,19 +18,22 @@ import suwayomi.tachidesk.test.clearTables
|
||||
class CategoryControllerTest : ApplicationTest() {
|
||||
@Test
|
||||
fun categoryReorder() {
|
||||
clearTables(
|
||||
CategoryTable,
|
||||
)
|
||||
Category.createCategory("foo")
|
||||
Category.createCategory("bar")
|
||||
val cats = Category.getCategoryList()
|
||||
val foo = cats.asSequence().filter { it.name == "foo" }.first()
|
||||
val bar = cats.asSequence().filter { it.name == "bar" }.first()
|
||||
assertEquals(1, foo.order)
|
||||
assertEquals(2, bar.order)
|
||||
assertEquals(0, foo.order)
|
||||
assertEquals(1, bar.order)
|
||||
Category.reorderCategory(1, 2)
|
||||
val catsReordered = Category.getCategoryList()
|
||||
val fooReordered = catsReordered.asSequence().filter { it.name == "foo" }.first()
|
||||
val barReordered = catsReordered.asSequence().filter { it.name == "bar" }.first()
|
||||
assertEquals(2, fooReordered.order)
|
||||
assertEquals(1, barReordered.order)
|
||||
assertEquals(1, fooReordered.order)
|
||||
assertEquals(0, barReordered.order)
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
|
||||
@@ -35,7 +35,7 @@ class CategoryMangaTest : ApplicationTest() {
|
||||
CategoryManga.getCategoryMangaList(DEFAULT_CATEGORY_ID)[0].unreadCount,
|
||||
"Manga should not have any unread chapters",
|
||||
)
|
||||
createChapters(mangaId, 10, false)
|
||||
createChapters(mangaId, 10, false, start = 11)
|
||||
assertEquals(
|
||||
10,
|
||||
CategoryManga.getCategoryMangaList(DEFAULT_CATEGORY_ID)[0].unreadCount,
|
||||
|
||||
Reference in New Issue
Block a user