diff --git a/crates/engine/src/shapes_behaviour_tests.rs b/crates/engine/src/shapes_behaviour_tests.rs index 4fad347ac..d7d35be27 100644 --- a/crates/engine/src/shapes_behaviour_tests.rs +++ b/crates/engine/src/shapes_behaviour_tests.rs @@ -582,7 +582,7 @@ fn outline_stroke_outlines_a_text_without_a_stroke() { let page = s.page().unwrap(); let out = ex(&mut s, "vector.outlineStroke", json!({"ids": [t]})); let ids: Vec = out["ids"].as_array().unwrap().iter().filter_map(id_of).collect(); - // Without a font nothing lays out, so there is nothing to outline (CI has no fonts). + // Without a font nothing lays out, so there is nothing to outline. if !figcraft_text::layout_node(&before).is_some_and(|(l, _)| !l.glyphs.is_empty()) { assert!(ids.is_empty() && matches!(node(&s, t).kind, NodeKind::Text(_)), "no glyphs: the text stays: {out}"); return; @@ -597,6 +597,16 @@ fn outline_stroke_outlines_a_text_without_a_stroke() { assert!(matches!(node(&s, t).kind, NodeKind::Text(_)), "undo brings the text back"); } +#[test] +fn outline_stroke_leaves_an_empty_text_as_it_is() { + // An empty text has no glyphs to outline: it stays, and nothing else changes. + let mut s = Session::new(); + let t = create(&mut s, "text.create", json!({"text": "", "x": 10, "y": 20})); + let out = ex(&mut s, "vector.outlineStroke", json!({"ids": [t]})); + assert_eq!(out["ids"], json!([]), "nothing outlined: {out}"); + assert!(matches!(node(&s, t).kind, NodeKind::Text(_)), "the text stays"); +} + #[test] fn node_set_non_numeric_miter_smoothing_paragraph_is_an_error() { let mut s = Session::new();