From 8cde91c41897647adda9ee94e7c06cc4b8994371 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 10:54:58 -0800 Subject: [PATCH] Tests: Save options radios start in the control column The craft-libs pin on main includes craft-libs#4231, which starts a radio row's options past the form's label column. A new test checks that in the EPS and .ai save options dialogs the All and Range radios start where the artboard check box starts, and that Transparent and Opaque start where the Preview menu starts. With the craft-libs rev pinned before #4231 it fails: All starts at x 526 and the check box at x 619. --- .../ui-egui/src/dialogs/save_options/tests.rs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/crates/ui-egui/src/dialogs/save_options/tests.rs b/crates/ui-egui/src/dialogs/save_options/tests.rs index 750e5b1130..666f094e60 100644 --- a/crates/ui-egui/src/dialogs/save_options/tests.rs +++ b/crates/ui-egui/src/dialogs/save_options/tests.rs @@ -568,6 +568,31 @@ fn save_options_radios_have_no_empty_caption_over_them() { } } +/// The All and Range radios start where the artboard check box above them starts, in the control column past the +/// captions, and EPS's Transparent and Opaque radios start where the Preview menu starts. +#[test] +fn save_options_radios_start_in_the_control_column() { + for (picked, check) in [("art.eps", "Use Artboards"), ("art.ai", "Save each artboard to a separate file")] { + let (mut app, _, _) = desktop(picked); + save_as(&mut app, "file.saveAs"); + let controls = labelled_controls(&mut app); + let (check, all, range) = (control(&controls, check), control(&controls, "All"), control(&controls, "Range:")); + assert!((all.left() - check.left()).abs() < 1.0, "{picked}: All at {all:?}, the check box at {check:?}"); + assert!((range.left() - check.left()).abs() < 1.0, "{picked}: Range at {range:?}, the check box at {check:?}"); + if picked == "art.eps" { + let (transparent, opaque) = (control(&controls, "Transparent"), control(&controls, "Opaque")); + let preview = controls + .iter() + .filter(|(l, r)| l.trim_end_matches(':') == "Preview" && r.bottom() <= transparent.top()) + .map(|(_, r)| *r) + .max_by(|a, b| a.bottom().total_cmp(&b.bottom())) + .expect("the Preview menu above Transparent"); + assert!((transparent.left() - preview.left()).abs() < 1.0, "Transparent at {transparent:?}, Preview at {preview:?}"); + assert!((opaque.left() - preview.left()).abs() < 1.0, "Opaque at {opaque:?}, Preview at {preview:?}"); + } + } +} + #[test] fn a_native_save_options_draft_cannot_redirect_its_path_to_another_drawing() { let (mut app, written, _) = desktop("original.vectorcraft");