fix(sonarr): pass the series ID alongside all TriggerAutomaticSeriesSearch events when publishing to the networking channel
This commit is contained in:
@@ -183,7 +183,7 @@ mod tests {
|
||||
#[rstest]
|
||||
#[case(
|
||||
ActiveSonarrBlock::AutomaticallySearchSeriesPrompt,
|
||||
SonarrEvent::TriggerAutomaticSeriesSearch(None)
|
||||
SonarrEvent::TriggerAutomaticSeriesSearch(1)
|
||||
)]
|
||||
#[case(
|
||||
ActiveSonarrBlock::UpdateAndScanSeriesPrompt,
|
||||
@@ -195,6 +195,7 @@ mod tests {
|
||||
) {
|
||||
let mut app = App::default();
|
||||
app.data.sonarr_data.prompt_confirm = true;
|
||||
app.data.sonarr_data.series.set_items(vec![series()]);
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesDetails.into());
|
||||
app.push_navigation_stack(prompt_block.into());
|
||||
|
||||
@@ -567,7 +568,7 @@ mod tests {
|
||||
#[rstest]
|
||||
#[case(
|
||||
ActiveSonarrBlock::AutomaticallySearchSeriesPrompt,
|
||||
SonarrEvent::TriggerAutomaticSeriesSearch(None)
|
||||
SonarrEvent::TriggerAutomaticSeriesSearch(1)
|
||||
)]
|
||||
#[case(
|
||||
ActiveSonarrBlock::UpdateAndScanSeriesPrompt,
|
||||
@@ -581,6 +582,7 @@ mod tests {
|
||||
) {
|
||||
let mut app = App::default();
|
||||
app.data.sonarr_data.prompt_confirm = true;
|
||||
app.data.sonarr_data.series.set_items(vec![series()]);
|
||||
app.push_navigation_stack(active_sonarr_block.into());
|
||||
app.push_navigation_stack(prompt_block.into());
|
||||
|
||||
@@ -629,6 +631,22 @@ mod tests {
|
||||
assert_eq!(series_id_season_number_tuple, (1, 1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_extract_series_id() {
|
||||
let mut app = App::default();
|
||||
app.data.sonarr_data.series.set_items(vec![series()]);
|
||||
|
||||
let series_id = SeriesDetailsHandler::with(
|
||||
DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesDetails,
|
||||
None,
|
||||
)
|
||||
.extract_series_id();
|
||||
|
||||
assert_eq!(series_id, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_details_handler_is_not_ready_when_loading() {
|
||||
let mut app = App::default();
|
||||
|
||||
Reference in New Issue
Block a user