From 752b91930f4029bea83688d787fa31373ec25521 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 06:55:12 -0800 Subject: [PATCH] Tests: the Artboard tool also releases the task bar's font field Selected type now shows a font family field in the Contextual Task Bar as well as in the Control bar and the Properties panel, so the test expects three fields. Each field is checked in its own app, so a wheel turn over one field does not start a stream that decides the next. --- crates/ui-egui/tests/font_wheel.rs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/tests/font_wheel.rs b/crates/ui-egui/tests/font_wheel.rs index 3cdb017d77..cfa63c31de 100644 --- a/crates/ui-egui/tests/font_wheel.rs +++ b/crates/ui-egui/tests/font_wheel.rs @@ -90,18 +90,24 @@ fn a_font_field_that_appears_under_a_still_pointer_leaves_the_wheel_until_the_po #[test] fn artboard_controls_leave_replaced_font_fields_wheel_available() { - let (ctx, mut app) = selected_type_with_control(); - let mut texts = Vec::new(); - for _ in 0..8 { - texts = frame(&mut app, &ctx, vec![]); - } - let fields: Vec<_> = texts.iter().filter(|(t, _)| t == "Inter").map(|(_, point)| *point).collect(); - assert_eq!(fields.len(), 2, "Control and Properties each show a font field"); - app.select_tool("artboard"); + let laid_out = || { + let (ctx, mut app) = selected_type_with_control(); + let mut texts = Vec::new(); + for _ in 0..8 { + texts = frame(&mut app, &ctx, vec![]); + } + let fields: Vec<_> = texts.iter().filter(|(t, _)| t == "Inter").map(|(_, point)| *point).collect(); + (ctx, app, fields) + }; + let (_, _, fields) = laid_out(); + assert_eq!(fields.len(), 3, "Control, Properties and the Contextual Task Bar each show a font field"); + // Each field gets its own app, so a wheel stream begun over one field cannot decide another. for point in fields { + let (ctx, mut app, _) = laid_out(); + app.select_tool("artboard"); let mut raw = wheel_input(point); app.raw_input_hook(&ctx, &mut raw); - assert!(raw.events.iter().any(|e| matches!(e, Event::MouseWheel { .. })), "the Artboard tool replaces this font field"); + assert!(raw.events.iter().any(|e| matches!(e, Event::MouseWheel { .. })), "the Artboard tool replaces the font field at {point:?}"); } }