推进 INI 面板状态汇总 helper
This commit is contained in:
84
wasm-port/tests/ui/node/verify_ini_panel_state_summary.mjs
Normal file
84
wasm-port/tests/ui/node/verify_ini_panel_state_summary.mjs
Normal file
@@ -0,0 +1,84 @@
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
import { createIniPanelStateSummary } from "../../../runtime/ui/ini-panel/panel-state-summary.js";
|
||||
|
||||
const summary = createIniPanelStateSummary({
|
||||
badges: {
|
||||
ini: "INI WASM: ready",
|
||||
interp: "Interpreter WASM: ready",
|
||||
opfs: "OPFS: ready",
|
||||
},
|
||||
machine: {
|
||||
machine: "xyzab-tdr",
|
||||
kinematics: "trivkins",
|
||||
},
|
||||
machineFiles: {
|
||||
iniOpfsPath: "linuxcnc/machines/xyzab-tdr/machine.ini",
|
||||
toolTableOpfsPath: "linuxcnc/machines/xyzab-tdr/tool.tbl",
|
||||
parameterOpfsPath: "linuxcnc/machines/xyzab-tdr/linuxcnc.var",
|
||||
gcodeOpfsPath: "linuxcnc/gcode/ui-session.ngc",
|
||||
},
|
||||
sessionSnapshot: {
|
||||
snapshotLabel: "ui-machine-session/ui-machine-session.json",
|
||||
workflow: "save-session-snapshot",
|
||||
},
|
||||
sessionLoad: {
|
||||
iniOpfsPath: "linuxcnc/machines/xyzab-tdr/machine.ini",
|
||||
iniWasmPath: "/work/session-machine.ini",
|
||||
},
|
||||
run: {
|
||||
runStatus: "ok",
|
||||
programSource: "snapshot",
|
||||
},
|
||||
fiveaxisRemap: "ok",
|
||||
});
|
||||
|
||||
assert.deepEqual(summary, {
|
||||
badges: {
|
||||
ini: "INI WASM: ready",
|
||||
interp: "Interpreter WASM: ready",
|
||||
opfs: "OPFS: ready",
|
||||
},
|
||||
machine: {
|
||||
machine: "xyzab-tdr",
|
||||
kinematics: "trivkins",
|
||||
},
|
||||
machineFiles: {
|
||||
iniOpfsPath: "linuxcnc/machines/xyzab-tdr/machine.ini",
|
||||
toolTableOpfsPath: "linuxcnc/machines/xyzab-tdr/tool.tbl",
|
||||
parameterOpfsPath: "linuxcnc/machines/xyzab-tdr/linuxcnc.var",
|
||||
gcodeOpfsPath: "linuxcnc/gcode/ui-session.ngc",
|
||||
},
|
||||
sessionSnapshot: {
|
||||
snapshotLabel: "ui-machine-session/ui-machine-session.json",
|
||||
workflow: "save-session-snapshot",
|
||||
},
|
||||
sessionLoad: {
|
||||
iniOpfsPath: "linuxcnc/machines/xyzab-tdr/machine.ini",
|
||||
iniWasmPath: "/work/session-machine.ini",
|
||||
},
|
||||
run: {
|
||||
runStatus: "ok",
|
||||
programSource: "snapshot",
|
||||
},
|
||||
fiveaxisRemap: "ok",
|
||||
});
|
||||
|
||||
assert.deepEqual(
|
||||
createIniPanelStateSummary(),
|
||||
{
|
||||
badges: {
|
||||
ini: null,
|
||||
interp: null,
|
||||
opfs: null,
|
||||
},
|
||||
machine: null,
|
||||
machineFiles: null,
|
||||
sessionSnapshot: null,
|
||||
sessionLoad: null,
|
||||
run: null,
|
||||
fiveaxisRemap: null,
|
||||
},
|
||||
);
|
||||
|
||||
console.log("ini_panel_state_summary_node_smoke=ok");
|
||||
6
wasm-port/tests/ui/node/verify_ini_panel_state_summary.sh
Executable file
6
wasm-port/tests/ui/node/verify_ini_panel_state_summary.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
|
||||
node "$ROOT_DIR/tests/ui/node/verify_ini_panel_state_summary.mjs"
|
||||
@@ -6,5 +6,6 @@ ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_run_summary.sh"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_session_summary.sh"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_machine_file_summary.sh"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ini_panel_state_summary.sh"
|
||||
|
||||
echo "ui_node_smokes=ok"
|
||||
|
||||
Reference in New Issue
Block a user