test: harden migration and UI coverage
This commit is contained in:
1 parent
9a390fd7a4
commit
e21f68fd7c
6 files changed
+146
-15
No files matched your search
@@ -1,4 +1,5 @@
|
||||
use super::*;
|
||||
use crate::tui::tests::UI_TEST_LOCK;
|
||||
use chrono::Utc;
|
||||
use crossterm::event::KeyModifiers;
|
||||
|
||||
@@ -282,6 +283,9 @@ fn discovery_delete_only_clears_the_matching_installed_badge() {
|
||||
|
||||
#[test]
|
||||
fn successful_install_marks_the_project_and_closes_the_popup() {
|
||||
let _guard = UI_TEST_LOCK
|
||||
.lock()
|
||||
.unwrap_or_else(|error| error.into_inner());
|
||||
let project = DiscoveryProject {
|
||||
id: "project".to_owned(),
|
||||
slug: "project".to_owned(),
|
||||
|
||||
@@ -351,13 +351,17 @@ async fn streamed_entries_wait_for_their_rendered_icon() {
|
||||
|
||||
let picker = ratatui_image::picker::Picker::halfblocks();
|
||||
state.request_image_loads(&picker);
|
||||
for _ in 0..20 {
|
||||
tokio::time::sleep(std::time::Duration::from_millis(5)).await;
|
||||
state.drain_image_loads(&picker);
|
||||
if !state.filtered_indices().is_empty() {
|
||||
break;
|
||||
tokio::time::timeout(std::time::Duration::from_secs(5), async {
|
||||
loop {
|
||||
state.drain_image_loads(&picker);
|
||||
if !state.filtered_indices().is_empty() {
|
||||
break;
|
||||
}
|
||||
tokio::task::yield_now().await;
|
||||
}
|
||||
}
|
||||
})
|
||||
.await
|
||||
.expect("icon render completed");
|
||||
|
||||
assert_eq!(state.filtered_indices(), vec![0]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user