Partial implementation of Tasks and Logs and test refactor

This commit is contained in:
2023-08-08 10:50:06 -06:00
parent 9d943a266e
commit 519778c0ca
42 changed files with 9914 additions and 9436 deletions
+33
View File
@@ -0,0 +1,33 @@
#[cfg(test)]
mod tests {
use rstest::rstest;
use crate::app::App;
use crate::event::Key;
use crate::handlers::{handle_clear_errors, handle_prompt_toggle};
#[test]
fn test_handle_clear_errors() {
let mut app = App::default();
app.error = "test error".to_owned().into();
handle_clear_errors(&mut app);
assert!(app.error.text.is_empty());
}
#[rstest]
fn test_handle_prompt_toggle_left_right(#[values(Key::Left, Key::Right)] key: Key) {
let mut app = App::default();
assert!(!app.data.radarr_data.prompt_confirm);
handle_prompt_toggle(&mut app, &key);
assert!(app.data.radarr_data.prompt_confirm);
handle_prompt_toggle(&mut app, &key);
assert!(!app.data.radarr_data.prompt_confirm);
}
}