From 52312331d818ffd6960de652d4c280a6e057957c Mon Sep 17 00:00:00 2001 From: Korg1ch <57859048+Korg1ch@users.noreply.github.com> Date: Tue, 20 Oct 2026 14:56:00 +0300 Subject: [PATCH] test(engine): Emboss saves as Embs with integer Angl/Hght/Amnt and loads back (#7946) --- crates/engine/src/atn_cmds/tests.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/crates/engine/src/atn_cmds/tests.rs b/crates/engine/src/atn_cmds/tests.rs index 1b5efa046c..c11f06332c 100644 --- a/crates/engine/src/atn_cmds/tests.rs +++ b/crates/engine/src/atn_cmds/tests.rs @@ -1323,6 +1323,28 @@ fn arbitrary_rotation_keeps_interpolation_through_atn() { } } +/// Filter › Stylize › Emboss saves as Photoshop's `Embs` event with integer `Angl`, `Hght` and +/// `Amnt`, and loads back as the same step (#7946: it was skipped, so a portable action lost it). +#[test] +fn emboss_saves_as_photoshops_event_and_loads_back() { + let mut s = Session::new(); + let params = json!({"angle": 130, "height": 1, "amount": 70}); + s.actions.list.push(Action::new("Pore", vec![("filter.stylize.emboss".into(), params.clone())])); + let r = s.execute("actions.save", json!({"action": "Pore"})).unwrap(); + assert_eq!(r["skipped"], json!([])); + let saved = photocraft_paint::tile::b64_decode(r["data"].as_str().unwrap()).unwrap(); + let file = atn::parse(&saved).unwrap(); + let step = &file.actions[0].items[0]; + assert_eq!(step.event.id(), "Embs"); + let d = step.descriptor.as_ref().unwrap(); + for (key, want) in [("Angl", 130), ("Hght", 1), ("Amnt", 70)] { + assert_eq!(d.get(key), Some(&D::Integer(want)), "{key}"); + } + let mut t = Session::new(); + t.execute("actions.load", json!({"data": b64(&saved)})).unwrap(); + assert_eq!(t.actions.list[0].steps, vec![("filter.stylize.emboss".to_string(), params)]); +} + /// A filter recorded against a layer mask must not export as a plain filter that edits the /// layer's pixels on replay: Photoshop's descriptor has no field for PhotoCraft's `target`. #[test]