feat: Support alternative keymappings for all keys, featuring hjkl movements
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
mod tests {
|
||||
use bimap::BiMap;
|
||||
use pretty_assertions::assert_str_eq;
|
||||
use rstest::rstest;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::key_binding::DEFAULT_KEYBINDINGS;
|
||||
@@ -926,7 +927,7 @@ mod tests {
|
||||
app.data.radarr_data.edit_collection_modal = Some(EditCollectionModal::default());
|
||||
|
||||
EditCollectionHandler::new(
|
||||
Key::Char('h'),
|
||||
Key::Char('a'),
|
||||
&mut app,
|
||||
ActiveRadarrBlock::EditCollectionRootFolderPathInput,
|
||||
None,
|
||||
@@ -942,7 +943,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.path
|
||||
.text,
|
||||
"h"
|
||||
"a"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1019,6 +1020,22 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn test_edit_collection_handler_ignore_alt_navigation(
|
||||
#[values(true, false)] should_ignore_quit_key: bool,
|
||||
) {
|
||||
let mut app = App::test_default();
|
||||
app.should_ignore_quit_key = should_ignore_quit_key;
|
||||
let handler = EditCollectionHandler::new(
|
||||
DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
ActiveRadarrBlock::default(),
|
||||
None,
|
||||
);
|
||||
|
||||
assert_eq!(handler.ignore_alt_navigation(), should_ignore_quit_key);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_build_edit_collection_params() {
|
||||
let mut app = App::test_default();
|
||||
|
||||
Reference in New Issue
Block a user