Refactored the key_mappings into files for context_clues for better naming conventions, and added unit tests for the clues and the contents of the ActiveRadarrBlock arrays that are used for chain-of-responsibility delegation in the handlers and UI components.

This commit is contained in:
2023-08-08 10:50:07 -06:00
parent 68aaa21030
commit dd339d1685
13 changed files with 710 additions and 114 deletions
+3 -3
View File
@@ -4,7 +4,7 @@ mod tests {
use pretty_assertions::{assert_eq, assert_str_eq};
use tokio::sync::mpsc;
use crate::app::key_binding::{build_keymapping_string, SERVARR_KEYMAPPINGS};
use crate::app::context_clues::{build_context_clue_string, SERVARR_CONTEXT_CLUES};
use crate::app::radarr::{ActiveRadarrBlock, RadarrData};
use crate::app::{App, Data, RadarrConfig, DEFAULT_ROUTE};
use crate::models::{HorizontallyScrollableText, Route, TabRoute};
@@ -29,14 +29,14 @@ mod tests {
route: ActiveRadarrBlock::Movies.into(),
help: format!(
"<↑↓> scroll | ←→ change tab | {} ",
build_keymapping_string(&SERVARR_KEYMAPPINGS)
build_context_clue_string(&SERVARR_CONTEXT_CLUES)
),
contextual_help: None,
},
TabRoute {
title: "Sonarr",
route: Route::Sonarr,
help: format!("{} ", build_keymapping_string(&SERVARR_KEYMAPPINGS)),
help: format!("{} ", build_context_clue_string(&SERVARR_CONTEXT_CLUES)),
contextual_help: None,
},
]