Refactored the UI module and the handlers module to do a more chain-of-responsibility method to manage the UI's and handlers for different key events. Also, initial work for indexer settings as well

This commit is contained in:
2023-08-08 10:50:07 -06:00
parent 718613d59f
commit cf11527fef
67 changed files with 5255 additions and 2216 deletions
@@ -0,0 +1,19 @@
#[cfg(test)]
mod tests {
use strum::IntoEnumIterator;
use crate::app::radarr::{ActiveRadarrBlock, DOWNLOADS_BLOCKS};
use crate::ui::radarr_ui::downloads::DownloadsUi;
use crate::ui::DrawUi;
#[test]
fn test_downloads_ui_accepts() {
ActiveRadarrBlock::iter().for_each(|active_radarr_block| {
if DOWNLOADS_BLOCKS.contains(&active_radarr_block) {
assert!(DownloadsUi::accepts(active_radarr_block.into()));
} else {
assert!(!DownloadsUi::accepts(active_radarr_block.into()));
}
});
}
}