From 350a4f408c3abd08ff7dc826e4c0757c2734ce7a Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Thu, 22 Oct 2026 13:10:11 -0600 Subject: [PATCH] #480: test that the Add and Delete Anchor Point tool icons are the Pen's icon with a badge The Add and Delete Anchor Point tools' icons were drawn apart from the Pen tool's, so the three didn't read as one family. The test checks that both tools' icons contain every shape of the Pen tool's icon plus a badge of their own, and that plus and minus differ. With the tool mapping pointing back at the old dc-pen-add and dc-pen-delete icons it fails: the Add tool's icon lacks the Pen's outline. --- crates/ui-egui/src/icons.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 52476db6f..8987cc64c 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -187,6 +187,31 @@ mod tests { assert!(appearance.contains(">(); + let pen = shapes(&svg("tool-pen")); + assert!(!pen.is_empty(), "the Pen's icon has shapes"); + let (add, delete) = (shapes(&svg("tool-pen-add")), shapes(&svg("tool-pen-delete"))); + for (tool, icon) in [("tool-pen-add", &add), ("tool-pen-delete", &delete)] { + for shape in &pen { + assert!(icon.contains(shape), "{tool}'s icon lacks the Pen's {shape}"); + } + assert!(icon.len() > pen.len(), "{tool}'s icon has a badge of its own"); + } + assert_ne!(add, delete, "plus and minus differ"); + } + #[test] fn shared_catalog_preserves_fallback_and_tool_aliases() { let ImageSource::Bytes { uri, bytes } = source("missing-icon") else { panic!("expected SVG bytes") };