mirror of
https://github.com/gotson/komga.git
synced 2026-05-09 05:10:19 +02:00
fix tests
This commit is contained in:
parent
5b252ed13a
commit
ff30013395
2 changed files with 15 additions and 2 deletions
|
|
@ -133,7 +133,7 @@ class SeriesController(
|
|||
ResponseEntity.ok()
|
||||
.cacheControl(thumbnailsCache)
|
||||
.body(thumbnail)
|
||||
} else throw ResponseStatusException(HttpStatus.NO_CONTENT)
|
||||
} else throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
} ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
|
||||
@GetMapping("{seriesId}/books")
|
||||
|
|
@ -182,7 +182,7 @@ class SeriesController(
|
|||
ResponseEntity.ok()
|
||||
.cacheControl(thumbnailsCache)
|
||||
.body(it.metadata.thumbnail)
|
||||
} else throw ResponseStatusException(HttpStatus.NO_CONTENT)
|
||||
} else throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
} ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -265,6 +265,19 @@ class SeriesControllerTest(
|
|||
|
||||
@Nested
|
||||
inner class BookMetadataNotReady {
|
||||
@Test
|
||||
@WithMockCustomUser
|
||||
fun `given book without thumbnail when getting series thumbnail then returns not found`() {
|
||||
val series = makeSeries(
|
||||
name = "series",
|
||||
books = listOf(makeBook("1"))
|
||||
).also { it.library = library }
|
||||
seriesRepository.save(series)
|
||||
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/api/v1/series/${series.id}/thumbnail"))
|
||||
.andExpect(MockMvcResultMatchers.status().isNotFound)
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithMockCustomUser
|
||||
fun `given book without thumbnail when getting book thumbnail then returns not found`() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue