diff --git a/src/tui/app/machine/fetch_state.rs b/src/tui/app/machine/fetch_state.rs index 9bdad65..a8efb7a 100644 --- a/src/tui/app/machine/fetch_state.rs +++ b/src/tui/app/machine/fetch_state.rs @@ -350,7 +350,7 @@ mod tests { let app = browse.increment_selection(Delta::Line); let app = app.unwrap_browse().fetch_musicbrainz(); - assert!(matches!(app, AppState::Match(_))); + assert!(matches!(app, AppState::Fetch(_))); } fn lookup_album_expectation( @@ -413,7 +413,7 @@ mod tests { let app = browse.increment_selection(Delta::Line); let app = app.unwrap_browse().fetch_musicbrainz(); - assert!(matches!(app, AppState::Match(_))); + assert!(matches!(app, AppState::Fetch(_))); } fn lookup_artist_expectation(job_sender: &mut MockIMbJobSender, artist: &ArtistMeta) { @@ -542,21 +542,23 @@ mod tests { } #[test] - fn recv_err_disconnected_first() { - let (_, rx) = mpsc::channel::(); + fn recv_err_empty_first() { + let mut collection = COLLECTION.clone(); + collection[0].albums.clear(); - let inner = inner(music_hoard(COLLECTION.clone())); - let fetch = FetchState::new(rx); - let app = AppMachine::app_fetch_next(inner, fetch); + let app = AppMachine::app_fetch_first(inner(music_hoard(collection))); assert!(matches!(app, AppState::Match(_))); } #[test] - fn recv_err_disconnected_next() { - let (_, rx) = mpsc::channel::(); + fn recv_err_empty_next() { + let mut collection = COLLECTION.clone(); + collection[0].albums.clear(); + let (_, rx) = mpsc::channel::(); let fetch = FetchState::new(rx); - let app = AppMachine::app_fetch_next(inner(music_hoard(COLLECTION.clone())), fetch); + + let app = AppMachine::app_fetch_next(inner(music_hoard(collection)), fetch); assert!(matches!(app, AppState::Browse(_))); }