mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-25 22:39:07 +00:00
Cut tools test registers the app's icons before checking them (#9230)
CI runs each test in its own process, where nothing else has registered them.
This commit is contained in:
@@ -10,6 +10,8 @@ fn the_cut_tools_have_their_own_icons_and_toolbar_slot() {
|
||||
for (tool, icon) in [("mirrorCut", "dc-mirror-cut"), ("lineCut", "dc-line-cut"), ("rectCut", "dc-rect-cut")] {
|
||||
let info = vectorcraft_tools::tool_info(tool).unwrap();
|
||||
assert_eq!(icons::tool_icon(info.icon), icon);
|
||||
// The app registers its icons at start; a test run alone in its process must too.
|
||||
craft::ui::primitives::register_app_icons(&icons::APP_ICONS);
|
||||
assert!(craft::ui::primitives::has_icon(&IconId::new(icon)), "{icon}");
|
||||
assert!(crate::toolbar::BASIC.iter().flat_map(|(_, slots)| slots.iter()).any(|s| s.contains(&tool) && s.contains(&"knife")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user