Manage Rules test: check the dialog rect and which rule was deleted

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
vangel76andClaude Sonnet 5.5 committed 2026-11-05 00:52:15 +01:00
1 parent 8c1c7cfd27
commit 51e242e1fa
1 file changed
+5 -1
+5 -1
View File
@@ -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]