tests are passing
This commit is contained in:
@@ -51,11 +51,22 @@ impl Component for TestComponent {
|
||||
self.field_b.clear();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_text(
|
||||
&mut self,
|
||||
focus: &Self::Focus,
|
||||
ch: char,
|
||||
) -> Result<Option<Self::Event>, tui_orchestrator::component::error::ComponentError> {
|
||||
match focus {
|
||||
Self::Focus::FieldA | Self::Focus::FieldB => Ok(Some(Self::Event::TextTyped(ch))),
|
||||
_ => Ok(None),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_component_targets() {
|
||||
let mut component = TestComponent {
|
||||
let component = TestComponent {
|
||||
field_a: alloc::string::String::new(),
|
||||
field_b: alloc::string::String::new(),
|
||||
};
|
||||
@@ -109,7 +120,7 @@ fn test_component_on_enter_clears() {
|
||||
|
||||
#[test]
|
||||
fn test_component_defaults() {
|
||||
let component = TestComponent {
|
||||
let mut component = TestComponent {
|
||||
field_a: alloc::string::String::new(),
|
||||
field_b: alloc::string::String::new(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user