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:
@@ -41,6 +41,18 @@ mod tests {
|
||||
assert_str_eq!(scrollable_text.get_text(), test_text);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_scrollable_text_is_empty() {
|
||||
let scrollable_text = ScrollableText::default();
|
||||
|
||||
assert!(scrollable_text.is_empty());
|
||||
|
||||
let test_text = "Test \nString";
|
||||
let scrollable_text = ScrollableText::with_string(test_text.to_owned());
|
||||
|
||||
assert!(!scrollable_text.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_scrollable_text_scroll() {
|
||||
let mut scrollable_text = ScrollableText::with_string("Test \nString".to_owned());
|
||||
|
||||
Reference in New Issue
Block a user