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_eq, assert_str_eq};
|
||||
use rstest::rstest;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::key_binding::DEFAULT_KEYBINDINGS;
|
||||
@@ -1243,7 +1244,7 @@ mod tests {
|
||||
app.data.sonarr_data.edit_series_modal = Some(EditSeriesModal::default());
|
||||
|
||||
EditSeriesHandler::new(
|
||||
Key::Char('h'),
|
||||
Key::Char('a'),
|
||||
&mut app,
|
||||
ActiveSonarrBlock::EditSeriesPathInput,
|
||||
None,
|
||||
@@ -1259,7 +1260,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.path
|
||||
.text,
|
||||
"h"
|
||||
"a"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1270,7 +1271,7 @@ mod tests {
|
||||
app.data.sonarr_data.edit_series_modal = Some(EditSeriesModal::default());
|
||||
|
||||
EditSeriesHandler::new(
|
||||
Key::Char('h'),
|
||||
Key::Char('a'),
|
||||
&mut app,
|
||||
ActiveSonarrBlock::EditSeriesTagsInput,
|
||||
None,
|
||||
@@ -1286,7 +1287,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.text,
|
||||
"h"
|
||||
"a"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1368,6 +1369,22 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn test_edit_series_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 = EditSeriesHandler::new(
|
||||
DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::default(),
|
||||
None,
|
||||
);
|
||||
|
||||
assert_eq!(handler.ignore_alt_navigation(), should_ignore_quit_key);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_build_edit_series_params() {
|
||||
let mut app = App::test_default();
|
||||
|
||||
Reference in New Issue
Block a user