feat(spec): serialize selector-only string targets for the runner to re-resolve

This commit is contained in:
pj committed 2026-06-01 16:58:59 +05:30
1 parent 1a9d82711f
commit 50cb9e98cb
2 files changed
+23 -7

No files matched your search

+11 -2
View File
@@ -119,8 +119,17 @@ test("builtin Scroll carries the pre-computed to endpoint", () => {
);
});
test("an unresolved (string) target drops the action", () => {
assert.equal(serializeAction({ kind: "Tap", on: "id:never-resolved" }), null);
test("a string target serializes selector-only for the runner to re-resolve", () => {
assert.deepEqual(serializeAction({ kind: "Tap", on: "id:save" }), {
kind: "Tap",
x: 0,
y: 0,
selector: "id:save",
});
});
test("an empty target or null action is dropped", () => {
assert.equal(serializeAction({ kind: "Tap", on: "" }), null);
assert.equal(serializeAction(null), null);
});