Refactored the movie_details_popup data into the MovieDetailsModal so things are neater and to follow the same format I've already established for other modals

This commit is contained in:
2023-08-11 16:37:21 -06:00
parent f7cb832095
commit ec9d23ede7
14 changed files with 1207 additions and 529 deletions
-38
View File
@@ -202,25 +202,6 @@ mod test_utils {
};
}
#[macro_export]
macro_rules! test_scrollable_text_scroll {
($func:ident, $handler:ident, $data_ref:ident, $block:expr) => {
#[test]
fn $func() {
let mut app = App::default();
app.data.radarr_data.$data_ref = ScrollableText::with_string("Test 1\nTest 2".to_owned());
$handler::with(&DEFAULT_KEYBINDINGS.up.key, &mut app, &$block, &None).handle();
assert_eq!(app.data.radarr_data.$data_ref.offset, 0);
$handler::with(&DEFAULT_KEYBINDINGS.down.key, &mut app, &$block, &None).handle();
assert_eq!(app.data.radarr_data.$data_ref.offset, 1);
}
};
}
#[macro_export]
macro_rules! test_iterable_home_and_end {
($func:ident, $handler:ident, $data_ref:ident, $block:expr, $context:expr) => {
@@ -326,25 +307,6 @@ mod test_utils {
};
}
#[macro_export]
macro_rules! test_scrollable_text_home_and_end {
($func:ident, $handler:ident, $data_ref:ident, $block:expr) => {
#[test]
fn $func() {
let mut app = App::default();
app.data.radarr_data.$data_ref = ScrollableText::with_string("Test 1\nTest 2".to_owned());
$handler::with(&DEFAULT_KEYBINDINGS.end.key, &mut app, &$block, &None).handle();
assert_eq!(app.data.radarr_data.$data_ref.offset, 1);
$handler::with(&DEFAULT_KEYBINDINGS.home.key, &mut app, &$block, &None).handle();
assert_eq!(app.data.radarr_data.$data_ref.offset, 0);
}
};
}
#[macro_export]
macro_rules! test_handler_delegation {
($handler:ident, $base:expr, $active_block:expr) => {