test: pin extract_task_name against a real selected task
Both tests seeded a single default task and asserted the extracted name equalled the default task name, so a body that ignored the table entirely and returned the default satisfied them. Radarr and Readarr already seed distinct named tasks and select one; these two now follow that shape. Verified by replacing both bodies with a bare default task name. The Lidarr test could not have failed before, since it compared the default against itself, and the run confirms it is the only Lidarr test that catches the change. The Sonarr body was already caught by the two start task prompt tests, so there the dedicated test is strengthened rather than newly load bearing.
This commit is contained in:
2 files changed
+24
-12
No files matched your search
@@ -970,11 +970,17 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_extract_task_name() {
|
fn test_extract_task_name() {
|
||||||
let mut app = App::test_default();
|
let mut app = App::test_default();
|
||||||
app
|
app.data.lidarr_data.tasks.set_items(vec![
|
||||||
.data
|
LidarrTask {
|
||||||
.lidarr_data
|
task_name: LidarrTaskName::Backup,
|
||||||
.tasks
|
..LidarrTask::default()
|
||||||
.set_items(vec![LidarrTask::default()]);
|
},
|
||||||
|
LidarrTask {
|
||||||
|
task_name: LidarrTaskName::RefreshArtist,
|
||||||
|
..LidarrTask::default()
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
app.data.lidarr_data.tasks.select_index(Some(1));
|
||||||
|
|
||||||
let task_name = SystemDetailsHandler::new(
|
let task_name = SystemDetailsHandler::new(
|
||||||
DEFAULT_KEYBINDINGS.esc.key,
|
DEFAULT_KEYBINDINGS.esc.key,
|
||||||
@@ -984,7 +990,7 @@ mod tests {
|
|||||||
)
|
)
|
||||||
.extract_task_name();
|
.extract_task_name();
|
||||||
|
|
||||||
assert_eq!(task_name, LidarrTaskName::default());
|
assert_eq!(task_name, LidarrTaskName::RefreshArtist);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -984,11 +984,17 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_extract_task_name() {
|
fn test_extract_task_name() {
|
||||||
let mut app = App::test_default();
|
let mut app = App::test_default();
|
||||||
app
|
app.data.sonarr_data.tasks.set_items(vec![
|
||||||
.data
|
SonarrTask {
|
||||||
.sonarr_data
|
task_name: SonarrTaskName::Backup,
|
||||||
.tasks
|
..SonarrTask::default()
|
||||||
.set_items(vec![SonarrTask::default()]);
|
},
|
||||||
|
SonarrTask {
|
||||||
|
task_name: SonarrTaskName::RefreshSeries,
|
||||||
|
..SonarrTask::default()
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
app.data.sonarr_data.tasks.select_index(Some(1));
|
||||||
|
|
||||||
let task_name = SystemDetailsHandler::new(
|
let task_name = SystemDetailsHandler::new(
|
||||||
DEFAULT_KEYBINDINGS.esc.key,
|
DEFAULT_KEYBINDINGS.esc.key,
|
||||||
@@ -998,7 +1004,7 @@ mod tests {
|
|||||||
)
|
)
|
||||||
.extract_task_name();
|
.extract_task_name();
|
||||||
|
|
||||||
assert_eq!(task_name, SonarrTaskName::default());
|
assert_eq!(task_name, SonarrTaskName::RefreshSeries);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in new issue
Block a user