test(forms): type export values through the properties widget

This commit is contained in:
FredApps committed 2026-10-13 19:31:14 +02:00
1 parent fc14719dff
commit 0e8d4d70fa
1 file changed
+12 -2
+12 -2
View File
@@ -500,6 +500,14 @@ fn actions_tab_adds_and_removes_actions() {
#[test]
fn button_export_properties_apply_cancel_and_undo() {
fn retype(h: &mut Harness<'static, PdfCraftApp>, value: &str) {
use egui::accesskit::Role;
h.get_by_role_and_label(Role::TextInput, "Export Value: ").click();
h.run_steps(1);
h.key_press_modifiers(egui::Modifiers::COMMAND, egui::Key::A);
h.get_by_role_and_label(Role::TextInput, "Export Value: ").type_text(value);
h.run_steps(2);
}
let mut h = harness();
h.state_mut().execute("form.prepare");
h.run_steps(2);
@@ -508,13 +516,15 @@ fn button_export_properties_apply_cancel_and_undo() {
h.get_by_label("Options").click();
h.run_steps(2);
let original = h.state().field_props.as_ref().unwrap().export_value.clone();
h.state_mut().field_props.as_mut().unwrap().export_value = "Accepted".into();
retype(&mut h, "Accepted");
h.get_by_label("Cancel").click();
h.run_steps(2);
h.state_mut().open_field_props("agree", 0);
h.run_steps(2);
assert_eq!(h.state().field_props.as_ref().unwrap().export_value, original);
h.state_mut().field_props.as_mut().unwrap().export_value = "Accepted".into();
h.get_by_label("Options").click();
h.run_steps(2);
retype(&mut h, "Accepted");
h.get_by_label("OK").click();
h.run_steps(3);
{