Measure panel tests: the Apply button is below the fold now (accesskit click) and the ratio field is named Drawing scale; premise only

This commit is contained in:
Dylan M. Taylor
2026-11-22 12:19:25 -05:00
parent e0e38557b7
commit 4f7d9cf354
+3 -3
View File
@@ -1286,7 +1286,7 @@ fn measurement_tools_draw_live_calibrate_save_and_export() {
h.state_mut().views[0].session.measure.page_unit = Some(pdfcraft_engine::measure::PageUnit::Pt);
h.state_mut().views[0].session.measure.real_distance = 1.0;
h.state_mut().views[0].session.measure.unit = "m".into();
h.get_by_label("Apply scale").click();
h.get_by_label("Apply scale").click_accesskit();
h.run_steps(3);
let scale = h.state().session.get(doc).unwrap().measurement_scale(0, [20.0, 20.0]).unwrap();
assert!((scale.x - 0.1).abs() < 1e-10);
@@ -1345,7 +1345,7 @@ fn a_1_to_50_scale_in_millimetres_measures_a_10_mm_line_as_500_mm() {
h.run_steps(3);
let m = &mut h.state_mut().views[0].session.measure;
(m.drawing_points, m.real_distance, m.unit) = (1.0, 50.0, "mm".into());
h.get_by_label("Apply scale").click();
h.get_by_label("Apply scale").click_accesskit();
h.run_steps(3);
let mm = 72.0 / 25.4;
let line = [[20.0, 30.0], [20.0 + 10.0 * mm, 30.0]];
@@ -1399,7 +1399,7 @@ fn a_plan_scale_picked_or_typed_applies_at_once() {
assert_eq!(read(&h), ("12.00 m".to_string(), "1 mm = 0.2 m".to_string()));
// Typed, in the other notations; leaving the field applies.
fn field<'a>(h: &'a Harness<'static, PdfCraftApp>) -> egui_kittest::Node<'a> {
h.get_by_role_and_label(egui::accesskit::Role::TextInput, "Scale")
h.get_by_role_and_label(egui::accesskit::Role::TextInput, "Drawing scale")
}
for (typed, label) in [("1/50", "3.00 m"), ("1:100", "6.00 m")] {
field(&h).click();