Skip to content

Commit aa4d322

Browse files
author
Peter Steinberger
committed
test(interactive): isolate presentation fallback regression coverage
1 parent 2195767 commit aa4d322

2 files changed

Lines changed: 29 additions & 25 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { describe, expect, it } from "vitest";
2+
import { renderMessagePresentationFallbackText } from "./payload.js";
3+
4+
describe("presentation fallback controls", () => {
5+
it("keeps typed select commands actionable without exposing callback values", () => {
6+
expect(
7+
renderMessagePresentationFallbackText({
8+
presentation: {
9+
blocks: [
10+
{
11+
type: "select",
12+
placeholder: "Environment",
13+
options: [
14+
{ label: "Canary", action: { type: "command", command: "/deploy canary" } },
15+
{
16+
label: "Production",
17+
action: { type: "command", command: "/deploy production" },
18+
},
19+
{ label: "Opaque", action: { type: "callback", value: "private-callback-token" } },
20+
],
21+
},
22+
],
23+
},
24+
}),
25+
).toBe(
26+
"Environment:\n- Canary: `/deploy canary`\n- Production: `/deploy production`\n- Opaque",
27+
);
28+
});
29+
});

‎src/interactive/payload.test.ts‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -546,31 +546,6 @@ describe("interactive payload helpers", () => {
546546
});
547547
});
548548

549-
it("keeps typed select commands actionable without exposing callback values", () => {
550-
expect(
551-
renderMessagePresentationFallbackText({
552-
presentation: {
553-
blocks: [
554-
{
555-
type: "select",
556-
placeholder: "Environment",
557-
options: [
558-
{ label: "Canary", action: { type: "command", command: "/deploy canary" } },
559-
{
560-
label: "Production",
561-
action: { type: "command", command: "/deploy production" },
562-
},
563-
{ label: "Opaque", action: { type: "callback", value: "private-callback-token" } },
564-
],
565-
},
566-
],
567-
},
568-
}),
569-
).toBe(
570-
"Environment:\n- Canary: `/deploy canary`\n- Production: `/deploy production`\n- Opaque",
571-
);
572-
});
573-
574549
it("normalizes question actions without exposing their transport data", () => {
575550
const action = {
576551
type: "question" as const,

0 commit comments

Comments
 (0)