fix(webui): improve automation management

This commit is contained in:
chengyongru
2026-06-14 18:24:59 +08:00
parent 6cf1f8e164
commit 747f0a08c7
15 changed files with 1376 additions and 91 deletions
+23
View File
@@ -25,6 +25,7 @@ import {
runCliAppAction,
runMcpPresetAction,
saveCustomMcpServer,
updateAutomation,
updateSidebarState,
updateImageGenerationSettings,
updateModelConfiguration,
@@ -123,6 +124,28 @@ describe("webui API helpers", () => {
);
});
it("serializes workspace automation updates", async () => {
await updateAutomation("tok", "job 1/2", {
name: "Daily quiz",
message: "Ask the quiz",
schedule: { kind: "cron", expr: "0 9 * * *", tz: "Asia/Shanghai" },
});
expect(fetch).toHaveBeenCalledWith(
"/api/webui/automations/update?id=job+1%2F2",
expect.objectContaining({
headers: {
Authorization: "Bearer tok",
"X-Nanobot-Automation-Values": JSON.stringify({
name: "Daily quiz",
message: "Ask the quiz",
schedule: { kind: "cron", expr: "0 9 * * *", tz: "Asia/Shanghai" },
}),
},
}),
);
});
it("fetches the WebUI skill summary", async () => {
await fetchSkills("tok");