From 1f6c9beb8c67df16329bd5fdac1553924c76a819 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 15:46:41 -0800 Subject: [PATCH] Tests: recorded steps keep a path only where the command takes it recorded_steps_filter_only_unreadable_locations expected object.setLiveShape's `path` to stay, but that command does not take a `path` param, so the recorded step reads the key as a file and drops a path outside the read root. The case now expects that, and text.createInPath, whose `path` is the id of a path in the document, covers a key that names part of the document. --- crates/ui-egui/src/control/tests.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/control/tests.rs b/crates/ui-egui/src/control/tests.rs index ec412ce413..97ed946339 100644 --- a/crates/ui-egui/src/control/tests.rs +++ b/crates/ui-egui/src/control/tests.rs @@ -308,7 +308,8 @@ fn a_url_naming_another_host_stays_without_a_read_root() { /// Under a read root, a recorded step loses a relative path outside it under a key that names a file /// or a folder as its command reads it (also inside a `command.batch` step), and a `file:` URL outside /// it under any key. A web link, a choice or a switch whose name ends like a path key's, and a key -/// that names part of the document in its command, keep their values. +/// that names part of the document in its command, keep their values; the same key in a command that +/// doesn't take it as a param names a file. #[test] fn recorded_steps_filter_only_unreadable_locations() { use vectorcraft_engine::cmd::ParamsPlace; @@ -321,6 +322,7 @@ fn recorded_steps_filter_only_unreadable_locations() { ("object.slice.options", json!({"url": "file:///elsewhere/a.html"})), ("object.path.simplify", json!({"wholePaths": "elsewhere/a", "alignToPath": "elsewhere/b", "linksFolder": "elsewhere/c"})), ("document.exportPresets.save", json!({"settings": {"folders": "item/format", "formats": [{"folder": "elsewhere/png"}]}})), + ("text.createInPath", json!({"path": "elsewhere/shape"})), ("object.setLiveShape", json!({"path": "elsewhere/shape"})), ("command.batch", json!({"commands": [{"command": "document.save", "params": {"path": "elsewhere/b.svg"}}]})), ]; @@ -342,6 +344,7 @@ fn recorded_steps_filter_only_unreadable_locations() { json!({"wholePaths": "elsewhere/a", "alignToPath": "elsewhere/b", "linksFolder": "elsewhere/c"}), json!({"settings": {"folders": "item/format", "formats": [{}]}}), json!({"path": "elsewhere/shape"}), + json!({}), json!({"commands": [{"command": "document.save", "params": {}}]}), ]; assert_eq!(filtered, want);