feat: add in-TUI settings editors
This commit is contained in:
1 parent
8c94e126c3
commit
c95f2d17ff
47 files changed
+2574
-741
No files matched your search
@@ -11,7 +11,7 @@ fn frame() -> Rect {
|
||||
|
||||
#[test]
|
||||
fn returns_none_after_dismiss_timeout() {
|
||||
let past_dismiss = SETTINGS.ui.error_auto_dismiss_ms as u128 + 1;
|
||||
let past_dismiss = SETTINGS.read().ui.error_auto_dismiss_ms as u128 + 1;
|
||||
assert!(popup_area(frame(), "msg", 0, past_dismiss).is_none());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2026 Constantin Bauer
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
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));
|
||||
}
|
||||
Reference in new issue
Block a user