Fix dialog header chevrons to collapse and restore forms

This commit is contained in:
lillith authored and bherbruck committed 2026-10-12 09:08:31 -04:00
1 parent db0a2a007a
commit 732447d2dc
3 files changed
+35 -1

No files matched your search

+21
View File
@@ -594,6 +594,27 @@ mod tests {
assert_eq!(a.session.doc.appearances.bodies.get("Body1"), a.session.doc.appearances.bodies.get("Body2"));
}
#[test]
fn header_chevron_folds_and_restores_appearance_inputs() {
let mut h = crate::scenario::Harness::new();
h.app.run("solid.box", json!({"length":10,"width":10,"height":10})).unwrap();
h.app.session.selection = vec![Sel::Body { name: "Body1".into() }];
h.app.start("appearance.assign");
h.frames(3);
let before = h.app.dialog.clone().unwrap();
h.step(&json!({"widget":"»"})).unwrap();
assert!(h.app.dialog.as_ref().unwrap().collapsed);
assert!(h.widget("Appearance name").is_none());
h.step(&json!({"widget":"«"})).unwrap();
let after = h.app.dialog.as_ref().unwrap();
assert!(!after.collapsed);
assert_eq!(format!("{:?}", after.inputs), format!("{:?}", before.inputs));
let (Kind::Appearance(before), Kind::Appearance(after)) = (&before.kind, &after.kind) else { panic!("appearance dialog") };
assert_eq!(before.color, after.color);
assert_eq!(before.opacity, after.opacity);
assert_eq!(before.search, after.search);
}
#[test]
fn real_frames_and_unchanged_apply_keep_precise_opacity() {
let mut h = crate::scenario::Harness::new();