





















@@ -1,7 +1,7 @@
11import { installChannelOutboundPayloadContractSuite } from "openclaw/plugin-sdk/channel-contract-testing";
22import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
33import { describe, expect, it } from "vitest";
4-import { createSlackOutboundPayloadHarness } from "../test-api.js";
4+import { createSlackOutboundPayloadHarness, slackOutbound } from "../test-api.js";
5566function createHarness(params: {
77payload: ReplyPayload;
@@ -64,6 +64,32 @@ describe("slackOutbound sendPayload", () => {
6464expect(result.messageId).toBe("sl-1");
6565});
666667+it("keeps the portable fallback when presentation renders no Slack blocks", async () => {
68+const payload: ReplyPayload = {
69+presentation: {
70+blocks: [
71+{
72+type: "buttons",
73+buttons: [{ label: "Launch", webApp: { url: "https://example.com/app" } }],
74+},
75+],
76+},
77+};
78+79+const rendered = await slackOutbound.renderPresentation?.({
80+ payload,
81+presentation: payload.presentation!,
82+ctx: {
83+cfg: {},
84+to: "C12345",
85+text: "",
86+ payload,
87+},
88+});
89+90+expect(rendered).toBeNull();
91+});
92+6793it("sends media before a separate interactive blocks message", async () => {
6894const { run, sendMock, to } = createHarness({
6995payload: {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。