Improved coverage

This commit is contained in:
veeso
2021-04-05 09:59:10 +02:00
parent 9776ecbe60
commit 7676e6e3a1
11 changed files with 57 additions and 0 deletions

View File

@@ -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))),