fix(tui): show spinner for indeterminate progress

This commit is contained in:
objz committed 2026-07-28 14:12:38 +02:00
1 parent b3c17b58c9
commit 6e898b8c45
2 files changed
+20 -2

No files matched your search

+18 -2
View File
@@ -23,7 +23,7 @@ fn newest_task_is_visible_and_drop_restores_previous_task() {
}
#[test]
fn changing_phase_keeps_the_existing_progress_visible() {
fn changing_phase_resets_progress_to_indeterminate() {
let _guard = TEST_LOCK.lock().unwrap();
clear();
let task = ProgressTask::start("inventory");
@@ -32,7 +32,7 @@ fn changing_phase_keeps_the_existing_progress_visible() {
let state = PROGRESS.lock().unwrap();
assert_eq!(state.current_action.as_deref(), Some("provider matching"));
assert_eq!(state.progress, Some((4, 10)));
assert_eq!(state.progress, None);
drop(state);
task.finish();
@@ -55,3 +55,19 @@ fn clearing_legacy_progress_keeps_owned_tasks() {
task.finish();
clear();
}
#[test]
fn a_new_legacy_action_does_not_reuse_the_previous_phase_progress() {
let _guard = TEST_LOCK.lock().unwrap();
clear();
set_action("Downloading installer");
set_progress(1, 1);
set_action("Running installer");
let state = PROGRESS.lock().unwrap();
assert_eq!(state.current_action.as_deref(), Some("Running installer"));
assert_eq!(state.progress, None);
drop(state);
clear();
}