docs(cli): add components send example

This commit is contained in:
Sebastian
2026-02-17 09:58:37 -05:00
parent 4536a6e05f
commit c0072be6a6
3 changed files with 29 additions and 0 deletions

View File

@@ -815,6 +815,24 @@ describe("runMessageAction components parsing", () => {
expect(handleAction).toHaveBeenCalled();
expect(result.payload).toMatchObject({ ok: true, components });
});
it("throws on invalid components JSON strings", async () => {
await expect(
runMessageAction({
cfg: {} as OpenClawConfig,
action: "send",
params: {
channel: "discord",
target: "channel:123",
message: "hi",
components: "{not-json}",
},
dryRun: false,
}),
).rejects.toThrow(/--components must be valid JSON/);
expect(handleAction).not.toHaveBeenCalled();
});
});
describe("runMessageAction accountId defaults", () => {