mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-05 02:51:40 +00:00
* fix(channels): preserve actionable presentation fallbacks * test(interactive): isolate presentation fallback regression coverage --------- Co-authored-by: Peter Steinberger <steipete@macos.shared>
30 lines
1008 B
TypeScript
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",
|
|
);
|
|
});
|
|
});
|