refactor(handler): Created a macro to handle all table key events to reduce code duplication and make future implementations faster; Only refactored the Sonarr library to use it thus far

This commit is contained in:
2024-12-07 19:20:13 -07:00
parent 23b1ca4371
commit 47b609369b
9 changed files with 547 additions and 259 deletions
+12
View File
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
use crate::models::radarr_models::Movie;
use crate::models::sonarr_models::Series;
use pretty_assertions::assert_eq;
use rstest::rstest;
@@ -30,6 +32,16 @@ mod tests {
let mut app = App::default();
app.push_navigation_stack(base_block);
app.push_navigation_stack(top_block);
app
.data
.sonarr_data
.series
.set_items(vec![Series::default()]);
app
.data
.radarr_data
.movies
.set_items(vec![Movie::default()]);
handle_events(DEFAULT_KEYBINDINGS.esc.key, &mut app);