mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-31 05:56:55 -06:00
@@ -5515,3 +5515,15 @@ fn transition_timing_invalid_after_keeps_value() {
|
||||
s.execute("transition.timing", &json!({"after": null})).unwrap();
|
||||
assert_eq!(after(&s), None);
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn invalid_ids_array_never_falls_back_to_the_selection() {
|
||||
let mut s = session();
|
||||
let a = s.execute("shape.insert", &json!({"preset": "rect", "rect": [100, 100, 100, 100]})).unwrap()["id"].as_u64().unwrap();
|
||||
for ids in [json!([-1]), json!([1.5]), json!([4294967296u64]), json!([-1, a])] {
|
||||
let r = s.execute("edit.delete", &json!({ "ids": ids }));
|
||||
assert!(matches!(r, Err(crate::EngineError::BadParams { .. })), "invalid ids {ids} gave {r:?}");
|
||||
assert!(s.doc().unwrap().shape(deckcraft_model::ShapeId(a as u32)).is_some(), "shape deleted for {ids}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user