mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
fix(tasks): treat blank JSON filters as absent (#103981)
* fix(tasks): normalize blank JSON filters * fix(tasks): reuse optional string normalization * fix(tasks): share blank filter normalization --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
@@ -520,6 +520,24 @@ describe("program routes", () => {
|
||||
{ json: true, runtime: "cron", status: undefined },
|
||||
defaultRuntime,
|
||||
);
|
||||
|
||||
await expect(
|
||||
listRoute.run([
|
||||
"node",
|
||||
"openclaw",
|
||||
"tasks",
|
||||
"list",
|
||||
"--json",
|
||||
"--runtime",
|
||||
" ",
|
||||
"--status",
|
||||
"\t",
|
||||
]),
|
||||
).resolves.toBe(true);
|
||||
expect(tasksListJsonCommandMock).toHaveBeenLastCalledWith(
|
||||
{ json: true, runtime: " ", status: "\t" },
|
||||
defaultRuntime,
|
||||
);
|
||||
});
|
||||
|
||||
it("routes parent task filter values that command-path discovery sees as positionals", async () => {
|
||||
@@ -584,6 +602,24 @@ describe("program routes", () => {
|
||||
{ json: true, severity: "error", code: "stale_running", limit: 5 },
|
||||
defaultRuntime,
|
||||
);
|
||||
|
||||
await expect(
|
||||
route.run([
|
||||
"node",
|
||||
"openclaw",
|
||||
"tasks",
|
||||
"audit",
|
||||
"--json",
|
||||
"--severity",
|
||||
" ",
|
||||
"--code",
|
||||
"\t",
|
||||
]),
|
||||
).resolves.toBe(true);
|
||||
expect(tasksAuditJsonCommandMock).toHaveBeenLastCalledWith(
|
||||
{ json: true, severity: " ", code: "\t", limit: undefined },
|
||||
defaultRuntime,
|
||||
);
|
||||
});
|
||||
|
||||
it("returns false for task JSON routes when option values are missing or unknown", async () => {
|
||||
|
||||
Reference in New Issue
Block a user