diff --git a/src/system/keys/keyringstorage.rs b/src/system/keys/keyringstorage.rs index c60fe56..3e0c46e 100644 --- a/src/system/keys/keyringstorage.rs +++ b/src/system/keys/keyringstorage.rs @@ -39,6 +39,7 @@ pub struct KeyringStorage { username: String, } +#[cfg(not(tarpaulin_include))] impl KeyringStorage { /// ### new /// @@ -50,6 +51,7 @@ impl KeyringStorage { } } +#[cfg(not(tarpaulin_include))] impl KeyStorage for KeyringStorage { /// ### get_key /// diff --git a/src/ui/layout/components/bookmark_list.rs b/src/ui/layout/components/bookmark_list.rs index 279e207..b64218f 100644 --- a/src/ui/layout/components/bookmark_list.rs +++ b/src/ui/layout/components/bookmark_list.rs @@ -303,6 +303,10 @@ mod tests { assert_eq!(component.states.focus, true); component.blur(); assert_eq!(component.states.focus, false); + // Update + let props = component.get_props().with_foreground(Color::Red).build(); + assert_eq!(component.update(props), Msg::None); + assert_eq!(component.props.foreground, Color::Red); // Increment list index component.states.list_index += 1; assert_eq!(component.states.list_index, 1); diff --git a/src/ui/layout/components/file_list.rs b/src/ui/layout/components/file_list.rs index 668a1fc..ed3c094 100644 --- a/src/ui/layout/components/file_list.rs +++ b/src/ui/layout/components/file_list.rs @@ -307,6 +307,10 @@ mod tests { assert_eq!(component.states.focus, true); component.blur(); assert_eq!(component.states.focus, false); + // Update + let props = component.get_props().with_foreground(Color::Red).build(); + assert_eq!(component.update(props), Msg::None); + assert_eq!(component.props.foreground, Color::Red); // Increment list index component.states.list_index += 1; assert_eq!(component.states.list_index, 1); diff --git a/src/ui/layout/components/input.rs b/src/ui/layout/components/input.rs index daa8068..632f349 100644 --- a/src/ui/layout/components/input.rs +++ b/src/ui/layout/components/input.rs @@ -342,6 +342,7 @@ mod tests { use super::*; use crossterm::event::KeyEvent; + use tui::style::Color; #[test] fn test_ui_layout_components_input_text() { @@ -362,6 +363,10 @@ mod tests { assert_eq!(component.states.focus, true); component.blur(); assert_eq!(component.states.focus, false); + // Update + let props = component.get_props().with_foreground(Color::Red).build(); + assert_eq!(component.update(props), Msg::None); + assert_eq!(component.props.foreground, Color::Red); // Get value assert_eq!(component.get_value(), Payload::Text(String::from("home"))); // RenderData diff --git a/src/ui/layout/components/logbox.rs b/src/ui/layout/components/logbox.rs index 90a395b..bb3aa75 100644 --- a/src/ui/layout/components/logbox.rs +++ b/src/ui/layout/components/logbox.rs @@ -310,6 +310,7 @@ mod tests { use crate::ui::layout::props::{TableBuilder, TextParts, TextSpan}; use crossterm::event::{KeyCode, KeyEvent}; + use tui::style::Color; #[test] fn test_ui_layout_components_logbox() { @@ -336,6 +337,10 @@ mod tests { assert_eq!(component.states.focus, true); component.blur(); assert_eq!(component.states.focus, false); + // Update + let props = component.get_props().with_foreground(Color::Red).build(); + assert_eq!(component.update(props), Msg::None); + assert_eq!(component.props.foreground, Color::Red); // Increment list index component.states.list_index += 1; assert_eq!(component.states.list_index, 1); diff --git a/src/ui/layout/components/msgbox.rs b/src/ui/layout/components/msgbox.rs index 2b536e0..bee1260 100644 --- a/src/ui/layout/components/msgbox.rs +++ b/src/ui/layout/components/msgbox.rs @@ -197,6 +197,12 @@ mod tests { )) .build(), ); + component.active(); + component.blur(); + // Update + let props = component.get_props().with_foreground(Color::Red).build(); + assert_eq!(component.update(props), Msg::None); + assert_eq!(component.props.foreground, Color::Red); // Get value assert_eq!(component.get_value(), Payload::None); // Event diff --git a/src/ui/layout/components/progress_bar.rs b/src/ui/layout/components/progress_bar.rs index 93a6438..585f142 100644 --- a/src/ui/layout/components/progress_bar.rs +++ b/src/ui/layout/components/progress_bar.rs @@ -155,6 +155,7 @@ mod tests { use crate::ui::layout::props::{TextParts, TextSpan}; use crossterm::event::{KeyCode, KeyEvent}; + use tui::style::Color; #[test] fn test_ui_layout_components_progress_bar() { @@ -168,6 +169,12 @@ mod tests { ); // Get value assert_eq!(component.get_value(), Payload::None); + component.active(); + component.blur(); + // Update + let props = component.get_props().with_foreground(Color::Red).build(); + assert_eq!(component.update(props), Msg::None); + assert_eq!(component.props.foreground, Color::Red); // Event assert_eq!( component.on(InputEvent::Key(KeyEvent::from(KeyCode::Delete))), diff --git a/src/ui/layout/components/radio_group.rs b/src/ui/layout/components/radio_group.rs index 51535eb..7132425 100644 --- a/src/ui/layout/components/radio_group.rs +++ b/src/ui/layout/components/radio_group.rs @@ -284,6 +284,10 @@ mod tests { assert_eq!(component.states.focus, true); component.blur(); assert_eq!(component.states.focus, false); + // Update + let props = component.get_props().with_foreground(Color::Red).build(); + assert_eq!(component.update(props), Msg::None); + assert_eq!(component.props.foreground, Color::Red); // Get value assert_eq!(component.get_value(), Payload::Unsigned(1)); // Handle events diff --git a/src/ui/layout/components/table.rs b/src/ui/layout/components/table.rs index c966f20..9062307 100644 --- a/src/ui/layout/components/table.rs +++ b/src/ui/layout/components/table.rs @@ -167,6 +167,7 @@ mod tests { use crate::ui::layout::props::{TableBuilder, TextParts, TextSpan}; use crossterm::event::{KeyCode, KeyEvent}; + use tui::style::Color; #[test] fn test_ui_layout_components_table() { @@ -184,6 +185,12 @@ mod tests { )) .build(), ); + component.active(); + component.blur(); + // Update + let props = component.get_props().with_foreground(Color::Red).build(); + assert_eq!(component.update(props), Msg::None); + assert_eq!(component.props.foreground, Color::Red); // Get value assert_eq!(component.get_value(), Payload::None); // Event diff --git a/src/ui/layout/components/text.rs b/src/ui/layout/components/text.rs index d2c1286..8aff07b 100644 --- a/src/ui/layout/components/text.rs +++ b/src/ui/layout/components/text.rs @@ -178,6 +178,12 @@ mod tests { )) .build(), ); + component.active(); + component.blur(); + // Update + let props = component.get_props().with_foreground(Color::Red).build(); + assert_eq!(component.update(props), Msg::None); + assert_eq!(component.props.foreground, Color::Red); // Get value assert_eq!(component.get_value(), Payload::None); // Event diff --git a/src/ui/layout/components/title.rs b/src/ui/layout/components/title.rs index 47c741d..52e3091 100644 --- a/src/ui/layout/components/title.rs +++ b/src/ui/layout/components/title.rs @@ -133,6 +133,7 @@ mod tests { use crate::ui::layout::props::TextParts; use crossterm::event::{KeyCode, KeyEvent}; + use tui::style::Color; #[test] fn test_ui_layout_components_title() { @@ -141,6 +142,12 @@ mod tests { .with_texts(TextParts::new(Some(String::from("Title")), None)) .build(), ); + component.active(); + component.blur(); + // Update + let props = component.get_props().with_foreground(Color::Red).build(); + assert_eq!(component.update(props), Msg::None); + assert_eq!(component.props.foreground, Color::Red); // Get value assert_eq!(component.get_value(), Payload::None); // Event