diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index ca0501c8f7..c19a0a72d2 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -4245,8 +4245,8 @@ fn given_targets_are_used_as_given_and_range_style_takes_the_selected_type() { /// #785: commands whose `ids` or `id` the shared check doesn't read (it reads `id` where it stands /// for `ids` of one) refuse one that isn't an object id. They don't act on the selection, the -/// current layer or a new object instead, and the document, the selection and the undo history -/// stay as they are. +/// current layer or a new object instead, and the document, the selection, the undo history, +/// isolation mode and the shown opacity mask stay as they are. #[test] fn malformed_ids_are_refused_by_commands_that_default_to_the_selection() { let mut s = session(); @@ -4294,17 +4294,19 @@ fn malformed_ids_are_refused_by_commands_that_default_to_the_selection() { if let Some(p) = p.as_object_mut() { p.insert(key.into(), bad.clone()); } - let (doc, selection, undo) = (s.doc().unwrap().doc.clone(), s.doc().unwrap().selection.clone(), s.doc().unwrap().history.undo.len()); + let st = s.doc().unwrap(); + let (doc, selection, undo, modes) = (st.doc.clone(), st.selection.clone(), st.history.undo.len(), (st.isolation, st.mask_view)); let r = s.execute(cmd, &p); let named = |e: &str| e.contains("object id") || e.contains("step reference") || e.contains(&format!("`{key}` must be")); let refused = r.as_ref().err().map(|e| e.to_string()).is_some_and(|e| named(&e)); - let same = s.doc().unwrap().doc == doc && s.doc().unwrap().selection == selection && s.doc().unwrap().history.undo.len() == undo; + let st = s.doc().unwrap(); + let same = st.doc == doc && st.selection == selection && st.history.undo.len() == undo && (st.isolation, st.mask_view) == modes; if !(refused && same) { wrong.push(format!("{cmd} {p}: {r:?}, document unchanged: {same}")); } if !same { let st = s.doc_mut().unwrap(); - (st.doc, st.selection) = (doc, selection); + (st.doc, st.selection, (st.isolation, st.mask_view)) = (doc, selection, modes); st.history.undo.truncate(undo); } }