fix: Updated the name of the should_ignore_quit_key to ignore_special_keys_for_textbox_input to give a better idea of what the flag is used for; also added alt keybinding for backspace
This commit is contained in:
@@ -549,7 +549,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_edit_movie_path_input_submit() {
|
||||
let mut app = App::test_default();
|
||||
app.should_ignore_quit_key = true;
|
||||
app.ignore_special_keys_for_textbox_input = true;
|
||||
app.data.radarr_data.edit_movie_modal = Some(EditMovieModal {
|
||||
path: "Test Path".into(),
|
||||
..EditMovieModal::default()
|
||||
@@ -565,7 +565,7 @@ mod tests {
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert!(!app.should_ignore_quit_key);
|
||||
assert!(!app.ignore_special_keys_for_textbox_input);
|
||||
assert!(!app
|
||||
.data
|
||||
.radarr_data
|
||||
@@ -584,7 +584,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_edit_movie_tags_input_submit() {
|
||||
let mut app = App::test_default();
|
||||
app.should_ignore_quit_key = true;
|
||||
app.ignore_special_keys_for_textbox_input = true;
|
||||
app.data.radarr_data.edit_movie_modal = Some(EditMovieModal {
|
||||
tags: "Test Tags".into(),
|
||||
..EditMovieModal::default()
|
||||
@@ -600,7 +600,7 @@ mod tests {
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert!(!app.should_ignore_quit_key);
|
||||
assert!(!app.ignore_special_keys_for_textbox_input);
|
||||
assert!(!app
|
||||
.data
|
||||
.radarr_data
|
||||
@@ -814,7 +814,7 @@ mod tests {
|
||||
if selected_block == ActiveRadarrBlock::EditMoviePathInput
|
||||
|| selected_block == ActiveRadarrBlock::EditMovieTagsInput
|
||||
{
|
||||
assert!(app.should_ignore_quit_key);
|
||||
assert!(app.ignore_special_keys_for_textbox_input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -852,7 +852,7 @@ mod tests {
|
||||
.into()
|
||||
);
|
||||
assert_eq!(app.data.radarr_data.prompt_confirm_action, None);
|
||||
assert!(!app.should_ignore_quit_key);
|
||||
assert!(!app.ignore_special_keys_for_textbox_input);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
@@ -886,7 +886,7 @@ mod tests {
|
||||
if active_radarr_block == ActiveRadarrBlock::EditMoviePathInput
|
||||
|| active_radarr_block == ActiveRadarrBlock::EditMovieTagsInput
|
||||
{
|
||||
assert!(!app.should_ignore_quit_key);
|
||||
assert!(!app.ignore_special_keys_for_textbox_input);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -912,13 +912,13 @@ mod tests {
|
||||
) {
|
||||
let mut app = App::test_default();
|
||||
app.data.radarr_data = create_test_radarr_data();
|
||||
app.should_ignore_quit_key = true;
|
||||
app.ignore_special_keys_for_textbox_input = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::EditMoviePrompt.into());
|
||||
app.push_navigation_stack(active_radarr_block.into());
|
||||
|
||||
EditMovieHandler::new(ESC_KEY, &mut app, active_radarr_block, None).handle();
|
||||
|
||||
assert!(!app.should_ignore_quit_key);
|
||||
assert!(!app.ignore_special_keys_for_textbox_input);
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
ActiveRadarrBlock::EditMoviePrompt.into()
|
||||
@@ -1150,11 +1150,11 @@ mod tests {
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn test_edit_movie_handler_ignore_alt_navigation(
|
||||
#[values(true, false)] should_ignore_quit_key: bool,
|
||||
fn test_edit_movie_handler_ignore_special_keys(
|
||||
#[values(true, false)] ignore_special_keys_for_textbox_input: bool,
|
||||
) {
|
||||
let mut app = App::test_default();
|
||||
app.should_ignore_quit_key = should_ignore_quit_key;
|
||||
app.ignore_special_keys_for_textbox_input = ignore_special_keys_for_textbox_input;
|
||||
let handler = EditMovieHandler::new(
|
||||
DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
@@ -1162,7 +1162,10 @@ mod tests {
|
||||
None,
|
||||
);
|
||||
|
||||
assert_eq!(handler.ignore_alt_navigation(), should_ignore_quit_key);
|
||||
assert_eq!(
|
||||
handler.ignore_special_keys(),
|
||||
ignore_special_keys_for_textbox_input
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user