收敛 INI 面板状态 API namespace
This commit is contained in:
@@ -367,6 +367,10 @@ TOOL_TABLE = browser-tool.tbl
|
||||
() => uiDocument.getElementById("opfs-badge")?.textContent.includes("ready"),
|
||||
"INI panel OPFS readiness",
|
||||
);
|
||||
const uiApi = uiDocument.defaultView.linuxCncIniPanelApi;
|
||||
if (!uiApi?.getMachineSessionStateReport || !uiApi?.getMachineSessionStateReportExport) {
|
||||
throw new Error("INI panel API namespace did not expose state report getters");
|
||||
}
|
||||
|
||||
uiDocument.getElementById("ini-editor").value = iniText;
|
||||
uiDocument.getElementById("query").click();
|
||||
@@ -493,7 +497,7 @@ TOOL_TABLE = browser-tool.tbl
|
||||
) {
|
||||
throw new Error(`UI saved snapshot log missing metadata summary: ${savedSnapshotLog}`);
|
||||
}
|
||||
const savedMachineSessionStateReport = uiDocument.defaultView.getMachineSessionStateReport();
|
||||
const savedMachineSessionStateReport = uiApi.getMachineSessionStateReport();
|
||||
assertEqual(
|
||||
savedMachineSessionStateReport.session.snapshotLabel,
|
||||
"ui-machine-session/ui-machine-session.json",
|
||||
@@ -588,7 +592,7 @@ TOOL_TABLE = browser-tool.tbl
|
||||
) {
|
||||
throw new Error(`UI restore/load session log missing OPFS default file mapping: ${uiLog}`);
|
||||
}
|
||||
const restoredLoadedMachineSessionStateReport = uiDocument.defaultView.getMachineSessionStateReport();
|
||||
const restoredLoadedMachineSessionStateReport = uiApi.getMachineSessionStateReport();
|
||||
assertEqual(
|
||||
restoredLoadedMachineSessionStateReport.session.snapshotLabel,
|
||||
"ui-machine-session/ui-machine-session.json",
|
||||
@@ -697,7 +701,7 @@ TOOL_TABLE = browser-tool.tbl
|
||||
2,
|
||||
"UI snapshot run summary motion snapshot count",
|
||||
);
|
||||
const machineSessionStateReport = uiDocument.defaultView.getMachineSessionStateReport();
|
||||
const machineSessionStateReport = uiApi.getMachineSessionStateReport();
|
||||
assertEqual(
|
||||
machineSessionStateReport.status.lastAction,
|
||||
"run-gcode",
|
||||
@@ -743,7 +747,7 @@ TOOL_TABLE = browser-tool.tbl
|
||||
2,
|
||||
"UI machine session state report motion snapshot count",
|
||||
);
|
||||
const machineSessionStateReportExport = uiDocument.defaultView.getMachineSessionStateReportExport();
|
||||
const machineSessionStateReportExport = uiApi.getMachineSessionStateReportExport();
|
||||
assertEqual(
|
||||
machineSessionStateReportExport.filename,
|
||||
"machine-session-state-report.json",
|
||||
@@ -769,6 +773,16 @@ TOOL_TABLE = browser-tool.tbl
|
||||
"snapshot",
|
||||
"UI machine session state report export program source",
|
||||
);
|
||||
assertEqual(
|
||||
uiDocument.defaultView.getMachineSessionStateReport().status.lastAction,
|
||||
machineSessionStateReport.status.lastAction,
|
||||
"UI legacy machine session state report getter matches API namespace",
|
||||
);
|
||||
assertEqual(
|
||||
uiDocument.defaultView.getMachineSessionStateReportExport().text,
|
||||
machineSessionStateReportExport.text,
|
||||
"UI legacy machine session state report export getter matches API namespace",
|
||||
);
|
||||
if (
|
||||
!runLog.includes("canon_event=STRAIGHT_TRAVERSE") ||
|
||||
!runLog.includes("canon_event=STRAIGHT_FEED")
|
||||
|
||||
@@ -330,4 +330,15 @@ assert.deepEqual(
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
{
|
||||
getMachineSessionStateReport: typeof globalThis.window?.linuxCncIniPanelApi?.getMachineSessionStateReport,
|
||||
getMachineSessionStateReportExport: typeof globalThis.window?.linuxCncIniPanelApi?.getMachineSessionStateReportExport,
|
||||
},
|
||||
{
|
||||
getMachineSessionStateReport: "undefined",
|
||||
getMachineSessionStateReportExport: "undefined",
|
||||
},
|
||||
);
|
||||
|
||||
console.log("ini_panel_state_summary_node_smoke=ok");
|
||||
|
||||
Reference in New Issue
Block a user