Pencil: check the drawn toggle states after a tool switch (#11962)

This commit is contained in:
Raghav Krishna committed 2026-11-09 19:44:12 +05:30
1 parent f41a39276a
commit 3576f83b50
1 file changed
+4
@@ -116,6 +116,10 @@ fn the_brush_keeps_its_own_pressure_flags() {
h.state_mut().ui.tool = Tool::Pencil;
h.run_steps(4);
assert_eq!(flags(&h), (true, false), "the mixed pair came back unchanged");
// And the bar draws that pair, not just stores it.
let on = |h: &Harness<'static, PhotocraftApp>, label: &str| h.get_by_label(label).accesskit_node().toggled() == Some(egui::accesskit::Toggled::True);
assert!(on(&h, "Always use pressure for opacity"), "the opacity toggle reads as on");
assert!(!on(&h, "Always use pressure for size"), "the size toggle reads as off");
}
#[test]