Files
openclaw/src/interactive/payload.fallback.test.ts
Peter Steinberger c572982556 fix(channels): preserve actionable presentation fallbacks (#116990)
* fix(channels): preserve actionable presentation fallbacks

* test(interactive): isolate presentation fallback regression coverage

---------

Co-authored-by: Peter Steinberger <steipete@macos.shared>
2026-07-31 12:37:30 -07:00

30 lines
1008 B
TypeScript

import { describe, expect, it } from "vitest";
import { renderMessagePresentationFallbackText } from "./payload.js";
describe("presentation fallback controls", () => {
it("keeps typed select commands actionable without exposing callback values", () => {
expect(
renderMessagePresentationFallbackText({
presentation: {
blocks: [
{
type: "select",
placeholder: "Environment",
options: [
{ label: "Canary", action: { type: "command", command: "/deploy canary" } },
{
label: "Production",
action: { type: "command", command: "/deploy production" },
},
{ label: "Opaque", action: { type: "callback", value: "private-callback-token" } },
],
},
],
},
}),
).toBe(
"Environment:\n- Canary: `/deploy canary`\n- Production: `/deploy production`\n- Opaque",
);
});
});