Added the ability to view Radarr updates and remapped the events queue key to 'z'

This commit is contained in:
2023-08-08 10:50:07 -06:00
parent 0bad52b658
commit 0c7fc88e22
15 changed files with 406 additions and 80 deletions
+38
View File
@@ -238,6 +238,25 @@ 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) => {
@@ -373,6 +392,25 @@ 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_text_box_home_end_keys {
($handler:ident, $block:expr, $field:ident) => {