Provide a keyboard shortcut to pull all release groups of an artist #233

Merged
wojtek merged 14 commits from 160---provide-a-keyboard-shortcut-to-pull-all-release-groups-of-an-artist into main 2024-12-30 23:42:20 +01:00
Showing only changes of commit 264a3d52cb - Show all commits

View File

@ -370,7 +370,7 @@ mod tests {
use crate::tui::{
app::{
machine::tests::{inner, music_hoard},
machine::tests::{inner, inner_with_mb, music_hoard},
Delta, EntityMatches, IApp, IAppAccess, IAppInteractBrowse, MatchOption,
},
lib::interface::musicbrainz::{self, api::Entity, daemon::MockIMbJobSender},
@ -734,8 +734,18 @@ mod tests {
let mut collection = COLLECTION.clone();
collection[0].albums.clear();
let app = AppMachine::app_fetch_first(inner(music_hoard(collection)));
assert!(matches!(app, AppState::Browse(_)));
let requests = AppMachine::browse_release_group_job(&collection[0].meta.info.musicbrainz);
let mut mb_job_sender = MockIMbJobSender::new();
mb_job_sender
.expect_submit_background_job()
.with(predicate::always(), predicate::eq(requests))
.times(1)
.return_once(|_, _| Ok(()));
let inner = inner_with_mb(music_hoard(collection), mb_job_sender);
let app = AppMachine::app_fetch_first(inner);
assert!(matches!(app, AppState::Fetch(_)));
}
#[test]
@ -743,11 +753,11 @@ mod tests {
let mut collection = COLLECTION.clone();
collection[0].albums.clear();
let (_, rx) = mpsc::channel::<MbApiResult>();
let (_tx, rx) = mpsc::channel::<MbApiResult>();
let fetch = FetchState::search(rx);
let app = AppMachine::app_fetch_next(inner(music_hoard(collection)), fetch);
assert!(matches!(app, AppState::Browse(_)));
assert!(matches!(app, AppState::Fetch(_)));
}
#[test]