推进 UI run summary 文档一致性 guard

This commit is contained in:
2026-06-14 18:10:02 +08:00
parent b989de23ae
commit b2b8bd6b4f
3 changed files with 76 additions and 3 deletions

View File

@@ -37,6 +37,9 @@ vendored LinuxCNC runtime.
`snapshot` is the optional machine session snapshot loaded by the UI. The helper
reads only snapshot metadata such as `workflow` and `snapshotLabel`.
When `runtime.snapshotLabel` is present, it is used as the returned
`snapshotLabel`; otherwise the helper falls back to `snapshot.metadata.snapshotLabel`
and then `null`.
The returned summary has this shape:

View File

@@ -57,11 +57,21 @@ assert.deepEqual(
},
);
assert.equal(
assert.deepEqual(
createRunSummary(program, {
snapshotLabel: "override-session/override.json",
}, snapshot).snapshotLabel,
"override-session/override.json",
}, snapshot),
{
runStatus: "ok",
programSource: "snapshot",
snapshotLabel: "override-session/override.json",
workflow: "save-session-snapshot",
programOpfsPath: "linuxcnc/gcode/ui-session.ngc",
programWasmPath: "/work/ui-session.ngc",
iniWasmPath: null,
canonicalEventCount: 0,
motionSnapshotCount: 0,
},
);
assert.deepEqual(