Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

M6: a field without /TU shows no tooltip of its own (#3854)

mtlcl41081c08be3eaa4
diff --git a/crates/ui-egui/tests/forms.rs b/crates/ui-egui/tests/forms.rs
index b261d3316..f2f90577f 100644
--- a/crates/ui-egui/tests/forms.rs
+++ b/crates/ui-egui/tests/forms.rs
@@ -69,6 +69,9 @@ fn hovering_a_field_shows_its_tooltip() {
assert!(h.query_by_label("Your name").is_some(), "the name field's /TU shows on hover");
rest_on_field(&mut h, "city");
assert!(h.query_by_label("Your name").is_none(), "another field doesn't keep the tooltip");
+ // Nor shows one of its own: none has been shown since the pointer left `name` (well past the
+ // tooltip delay), so this isn't only the old label going away.
+ assert!(egui::Tooltip::seconds_since_last_tooltip(&h.ctx) > 0.3, "a field without /TU shows no tooltip");
}
/// Give the `city` field these properties, as the Properties dialog would.