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 <[email protected]>
This commit is contained in:
FredApps
2026-11-18 17:44:53 +07:00
parent 0eede0e4a7
commit 05be8a8096
+4 -2
View File
@@ -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;
}