Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

LRC-LIB-LIBFOLDERS: the count test waits for each folder toggle to be drawn before clicking it

Nathaniel Ledford93d605837284
diff --git a/crates/ui-egui/src/tests/panels.rs b/crates/ui-egui/src/tests/panels.rs
index 44a318646..3b35d37c0 100644
--- a/crates/ui-egui/src/tests/panels.rs
+++ b/crates/ui-egui/src/tests/panels.rs
@@ -1624,7 +1624,9 @@ fn folders_app_with_deep_labeled_chain() -> (Headless, String) {
for name in &names[..names.len() - 1] {
path.push('/');
path.push_str(name);
- let r = h.request("ui.clickWidget", json!({"id": format!("libraryFolderToggle:{path}")}), T);
+ let toggle = format!("libraryFolderToggle:{path}");
+ assert!(h.step_until(T, |h| has(h, &toggle)), "{toggle} is drawn");
+ let r = h.request("ui.clickWidget", json!({"id": toggle}), T);
assert_eq!(r["ok"], true, "{r}");
// the frame a new row is first drawn in, before the content has grown to what it asked for
h.step();