Handle idle time between fetch results #212

Merged
wojtek merged 18 commits from 211---handle-idle-time-between-fetch-results into main 2024-09-08 23:23:53 +02:00
2 changed files with 7 additions and 8 deletions
Showing only changes of commit 349332bd89 - Show all commits

View File

@ -166,13 +166,6 @@ mod tests {
app.unwrap_search(); app.unwrap_search();
} }
#[test]
fn fetch_musicbrainz_no_artist() {
let browse = AppMachine::browse(inner(music_hoard(vec![])));
let app = browse.fetch_musicbrainz();
app.unwrap_error();
}
#[test] #[test]
fn fetch_musicbrainz() { fn fetch_musicbrainz() {
let mb_api = MockIMusicBrainz::new(); let mb_api = MockIMusicBrainz::new();

View File

@ -199,7 +199,7 @@ mod tests {
use crate::tui::{ use crate::tui::{
app::{ app::{
machine::tests::{inner, music_hoard}, machine::tests::{inner, music_hoard},
AppAlbumMatches, AppArtistMatches, AppAlbumMatches, AppArtistMatches, IAppInteract,
}, },
event::EventReceiver, event::EventReceiver,
lib::interface::musicbrainz::{self, Match, MockIMusicBrainz}, lib::interface::musicbrainz::{self, Match, MockIMusicBrainz},
@ -209,6 +209,12 @@ mod tests {
use super::*; use super::*;
#[test]
fn fetch_no_artist() {
let app = AppMachine::app_fetch_new(inner(music_hoard(vec![])));
assert!(matches!(app.state(), AppState::Error(_)));
}
fn event_channel() -> (EventSender, EventReceiver) { fn event_channel() -> (EventSender, EventReceiver) {
let event_channel = EventChannel::new(); let event_channel = EventChannel::new();
let events_tx = event_channel.sender(); let events_tx = event_channel.sender();