From 51e242e1fa1ad79764115cb7f3427d1e539930ec Mon Sep 17 00:00:00 2001 From: vangel76 Date: Thu, 5 Nov 2026 00:52:15 +0100 Subject: [PATCH] Manage Rules test: check the dialog rect and which rule was deleted Co-Authored-By: Claude Sonnet 5.5 --- crates/ui-egui/tests/it/cf_rules_manager.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/tests/it/cf_rules_manager.rs b/crates/ui-egui/tests/it/cf_rules_manager.rs index 540b19403..d6f19a715 100644 --- a/crates/ui-egui/tests/it/cf_rules_manager.rs +++ b/crates/ui-egui/tests/it/cf_rules_manager.rs @@ -48,13 +48,17 @@ fn many_rules_scroll_inside_a_dialog_that_fits_the_window() { let lowest = deletes.iter().map(|d| d.rect().bottom()).fold(0.0, f32::max); assert!(lowest <= SCREEN_H, "the list stays inside the window, lowest button at {lowest}"); drop(deletes); + let window = h.get_by_label("Conditional Formatting Rules Manager").rect(); + assert!(window.bottom() <= SCREEN_H, "the dialog fits the window, bottom at {}", window.bottom()); // Deleting through the dialog removes the first rule and the dialog stays usable. // (The ribbon has a Delete button of its own, outside the dialog's window.) - let window = h.get_by_label("Conditional Formatting Rules Manager").rect(); h.query_all_by_label("Delete").find(|d| window.contains_rect(d.rect())).unwrap().click(); h.run_steps(4); let left = h.state().session.active().unwrap().wb.active().unwrap().cond_formats.len(); assert_eq!(left, RULES - 1); + let first = h.state().session.active().unwrap().wb.active().unwrap().cond_formats[0].ranges[0].a1(); + // New rules go first, so the one deleted was A3000. + assert_eq!(first, format!("A{}", RULES - 1), "the first rule was the one removed"); } #[test]