Parameters: reset the new row's expression after Add (#1170) (#1235)

After Add in Change Parameters, the new-parameter row's expression goes back to the default a new row starts with. Fixes #1170.
This commit is contained in:
DuBearte authored and GitHub committed 2026-10-14 21:45:04 -04:00
1 parent 2a4907884b
commit 9dc12b4d0f
2 files changed
+17 -1

No files matched your search

+13
View File
@@ -124,3 +124,16 @@ fn parameter_rename_arrow_keys_move_cursor_and_keep_editing() {
let result = h.app.session.execute("parameters.list", &json!({})).unwrap();
assert!(result["parameters"].as_array().unwrap().iter().any(|p| p["name"] == "plate_width"));
}
#[test]
fn parameter_add_resets_expression_for_next_row() {
let mut h = open();
let initial = h.app.params.as_ref().unwrap().new_expr.clone();
fill(&mut h, "name", "width");
fill(&mut h, "expression", "25 mm");
enter(&mut h, false);
let result = h.app.session.execute("parameters.list", &json!({})).unwrap();
assert!(result["parameters"].as_array().unwrap().iter().any(|p| p["name"] == "width" && p["expression"] == "25 mm"));
let d = h.app.params.as_ref().unwrap();
assert!(d.new_name.is_empty());
assert_eq!(d.new_expr, initial);
}