Refactored to require handlers to specify the components they rely on and to specify when they are ready. This fixes a lot of bugs with the UI when users try to press buttons while the application is still loading.
This commit is contained in:
@@ -102,6 +102,17 @@ mod tests {
|
||||
assert_eq!(stateful_list.state.selected(), Some(0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stateful_list_is_empty() {
|
||||
let mut stateful_list = create_test_stateful_list();
|
||||
|
||||
assert!(!stateful_list.is_empty());
|
||||
|
||||
stateful_list = StatefulList::default();
|
||||
|
||||
assert!(stateful_list.is_empty());
|
||||
}
|
||||
|
||||
fn create_test_stateful_list() -> StatefulList<&'static str> {
|
||||
let mut stateful_list = StatefulList::default();
|
||||
stateful_list.set_items(vec!["Test 1", "Test 2"]);
|
||||
|
||||
Reference in New Issue
Block a user