Enable fetch to apply modifications to the database #221
@ -350,7 +350,7 @@ mod tests {
|
|||||||
let app = browse.increment_selection(Delta::Line);
|
let app = browse.increment_selection(Delta::Line);
|
||||||
|
|
||||||
let app = app.unwrap_browse().fetch_musicbrainz();
|
let app = app.unwrap_browse().fetch_musicbrainz();
|
||||||
assert!(matches!(app, AppState::Match(_)));
|
assert!(matches!(app, AppState::Fetch(_)));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lookup_album_expectation(
|
fn lookup_album_expectation(
|
||||||
@ -413,7 +413,7 @@ mod tests {
|
|||||||
let app = browse.increment_selection(Delta::Line);
|
let app = browse.increment_selection(Delta::Line);
|
||||||
|
|
||||||
let app = app.unwrap_browse().fetch_musicbrainz();
|
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) {
|
fn lookup_artist_expectation(job_sender: &mut MockIMbJobSender, artist: &ArtistMeta) {
|
||||||
@ -542,21 +542,23 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn recv_err_disconnected_first() {
|
fn recv_err_empty_first() {
|
||||||
let (_, rx) = mpsc::channel::<MbApiResult>();
|
let mut collection = COLLECTION.clone();
|
||||||
|
collection[0].albums.clear();
|
||||||
|
|
||||||
let inner = inner(music_hoard(COLLECTION.clone()));
|
let app = AppMachine::app_fetch_first(inner(music_hoard(collection)));
|
||||||
let fetch = FetchState::new(rx);
|
|
||||||
let app = AppMachine::app_fetch_next(inner, fetch);
|
|
||||||
assert!(matches!(app, AppState::Match(_)));
|
assert!(matches!(app, AppState::Match(_)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn recv_err_disconnected_next() {
|
fn recv_err_empty_next() {
|
||||||
let (_, rx) = mpsc::channel::<MbApiResult>();
|
let mut collection = COLLECTION.clone();
|
||||||
|
collection[0].albums.clear();
|
||||||
|
|
||||||
|
let (_, rx) = mpsc::channel::<MbApiResult>();
|
||||||
let fetch = FetchState::new(rx);
|
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(_)));
|
assert!(matches!(app, AppState::Browse(_)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user