From ffe56740a236fad68c4c58da98e540d8ab8d441f Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Nov 2026 16:16:07 +0100 Subject: [PATCH] test(ui-egui): the Fill opacity alert test fails on an unnamed dialog window (#14649) --- crates/ui-egui/src/dialogs/fill_ui/opacity_alert_tests.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/dialogs/fill_ui/opacity_alert_tests.rs b/crates/ui-egui/src/dialogs/fill_ui/opacity_alert_tests.rs index 7dc9c7398d..99473e18cc 100644 --- a/crates/ui-egui/src/dialogs/fill_ui/opacity_alert_tests.rs +++ b/crates/ui-egui/src/dialogs/fill_ui/opacity_alert_tests.rs @@ -76,8 +76,9 @@ fn dismiss(h: &mut H, command: &str) { h.run_steps(3); } -fn titles(h: &H) -> Vec { - h.query_all_by_role(Role::Dialog).chain(h.query_all_by_role(Role::AlertDialog)).filter_map(|n| n.accesskit_node().label()).collect() +/// The names of the open dialog windows, unnamed ones included. +fn titles(h: &H) -> Vec> { + h.query_all_by_role(Role::Dialog).chain(h.query_all_by_role(Role::AlertDialog)).map(|n| n.accesskit_node().label()).collect() } fn check(open: fn(&mut PhotocraftApp), command: &str, title: &str) { @@ -92,7 +93,8 @@ fn check(open: fn(&mut PhotocraftApp), command: &str, title: &str) { } let message = alert(&h).unwrap_or_else(|| panic!("{title}: {typed} raises the range alert")); assert!(message.contains("integer between 1") && message.contains("100"), "{title}: {message}"); - assert!(titles(&h).iter().all(|t| t == title), "{title}: the alert is titled after the dialog: {:?}", titles(&h)); + let windows = titles(&h); + assert!(windows.len() == 2 && windows.iter().all(|t| t.as_deref() == Some(title)), "{title}: the dialog and its alert: {windows:?}"); dismiss(&mut h, command); } type_and_tab(&mut h, "42");