mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-30 18:25:34 +01:00
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.
This commit is contained in:
1 parent
9bbc3950e1
commit
8cde91c418
1 file changed
+25
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user