From 05be8a8096e42739434d8dced01e0d98afc3a2ba Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Wed, 18 Nov 2026 17:44:53 +0700 Subject: [PATCH] Tests: aim the title bar button helper at the button's own node The Save button's accessible label carries its tooltip text, so the label query matches the button itself on the first hover position, left of the button, and the click missed it. Return the matched node's centre instead of the hover position. Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com> --- crates/ui-egui/tests/it/file_menu.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/tests/it/file_menu.rs b/crates/ui-egui/tests/it/file_menu.rs index 0bde33944..4ec8aab60 100644 --- a/crates/ui-egui/tests/it/file_menu.rs +++ b/crates/ui-egui/tests/it/file_menu.rs @@ -176,8 +176,10 @@ fn title_bar_button(h: &mut egui_kittest::Harness<'static, SheetApp>, name: &str let at = egui::pos2(x, autosave.center().y); h.hover_at(at); h.run_steps(3); - if h.query_by_label_contains(&tip).is_some() { - return at; + // The button's accessible label carries its tooltip, so the node found may be the button + // itself rather than a tooltip at the pointer: aim at the node. + if let Some(node) = h.query_by_label_contains(&tip) { + return node.rect().center(); } x += 6.0; }