test(tui): externalize and expand UI coverage
This commit is contained in:
1 parent
868f3e5b9d
commit
6138e248cb
60 files changed
+3193
-2700
No files matched your search
@@ -565,21 +565,4 @@ pub fn handle_key(
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn removing_selected_last_profile_clamps_selection() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let mut state = SettingsState::new(tmp.path().to_path_buf());
|
||||
state.profiles = vec!["first".to_string(), "second".to_string()];
|
||||
state.active_profile = Some("second".to_string());
|
||||
state.list_state.selected = Some(2);
|
||||
|
||||
state.remove_profile("second");
|
||||
|
||||
assert_eq!(state.profiles, vec!["first"]);
|
||||
assert_eq!(state.active_profile, None);
|
||||
assert_eq!(state.list_state.selected, Some(1));
|
||||
}
|
||||
}
|
||||
mod tests;
|
||||
Reference in new issue
Block a user