fix(sonarr): Pass series ID alognside all GetEpisodes events when publishing to the networking channel
This commit is contained in:
@@ -81,6 +81,10 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn test_dispatch_by_season_details_block() {
|
||||
let (mut app, mut sync_network_rx) = construct_app_unit();
|
||||
app.data.sonarr_data.series.set_items(vec![Series {
|
||||
id: 1,
|
||||
..Series::default()
|
||||
}]);
|
||||
|
||||
app
|
||||
.dispatch_by_sonarr_block(&ActiveSonarrBlock::SeasonDetails)
|
||||
@@ -89,7 +93,7 @@ mod tests {
|
||||
assert!(app.is_loading);
|
||||
assert_eq!(
|
||||
sync_network_rx.recv().await.unwrap(),
|
||||
SonarrEvent::GetEpisodes(None).into()
|
||||
SonarrEvent::GetEpisodes(1).into()
|
||||
);
|
||||
assert_eq!(
|
||||
sync_network_rx.recv().await.unwrap(),
|
||||
@@ -746,6 +750,17 @@ mod tests {
|
||||
assert_eq!(app.extract_episode_id().await, 0);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_extract_series_id() {
|
||||
let mut app = App::default();
|
||||
app.data.sonarr_data.series.set_items(vec![Series {
|
||||
id: 1,
|
||||
..Series::default()
|
||||
}]);
|
||||
|
||||
assert_eq!(app.extract_series_id().await, 1);
|
||||
}
|
||||
|
||||
fn construct_app_unit<'a>() -> (App<'a>, mpsc::Receiver<NetworkEvent>) {
|
||||
let (sync_network_tx, sync_network_rx) = mpsc::channel::<NetworkEvent>(500);
|
||||
let mut app = App {
|
||||
|
||||
Reference in New Issue
Block a user