test(sonarr): give the download record and episode fixtures distinct ids
The shared download record held id and episode id both equal to 1, and the shared episode held id and episode file id both equal to 1, so reading the wrong one of those fields could not fail any test that uses them. Move the download record to id 9 and the episode to id 11, keeping the download record's episode id equal to the episode's id so the downloading episode still matches, and move the episode file to id 7 together with the episode's episode file id so the season view still finds its quality and size. Series id, season number, and episode number stay at 1. The handler tree keeps its own copy of these fixtures; update it identically, along with the JSON twins in the network tests and the seven handler assertions that named the old ids. The two get episodes tests that asserted the sorted table now spell out the sorted order, since the fixture episode no longer sorts first by id.
This commit is contained in:
7 files changed
+28
-27
No files matched your search
@@ -191,8 +191,8 @@ pub(in crate::handlers::sonarr_handlers) mod utils {
|
||||
DownloadRecord {
|
||||
title: "Test Download Title".to_owned(),
|
||||
status: DownloadStatus::Downloading,
|
||||
id: 1,
|
||||
episode_id: Some(Number::from(1i64)),
|
||||
id: 9,
|
||||
episode_id: Some(Number::from(11i64)),
|
||||
size: 3543348019f64,
|
||||
sizeleft: 1771674009f64,
|
||||
output_path: Some(HorizontallyScrollableText::from(
|
||||
@@ -205,10 +205,10 @@ pub(in crate::handlers::sonarr_handlers) mod utils {
|
||||
|
||||
pub fn episode() -> Episode {
|
||||
Episode {
|
||||
id: 1,
|
||||
id: 11,
|
||||
series_id: 1,
|
||||
tvdb_id: 1234,
|
||||
episode_file_id: 1,
|
||||
episode_file_id: 7,
|
||||
season_number: 1,
|
||||
episode_number: 1,
|
||||
title: "Something cool".to_owned(),
|
||||
@@ -224,7 +224,7 @@ pub(in crate::handlers::sonarr_handlers) mod utils {
|
||||
|
||||
pub fn episode_file() -> EpisodeFile {
|
||||
EpisodeFile {
|
||||
id: 1,
|
||||
id: 7,
|
||||
relative_path: "/season 1/episode 1.mkv".to_owned(),
|
||||
path: "/nfs/tv/series/season 1/episode 1.mkv".to_owned(),
|
||||
size: 3543348019,
|
||||
|
||||
Reference in new issue
Block a user