From 8f41001edf9fc85616fd45a64959cdac5da746ec Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 15 Mar 2026 18:53:04 -0700 Subject: [PATCH] Reply: update shared interactive normalize tests --- src/auto-reply/reply/reply-utils.test.ts | 60 +++++++++--------------- 1 file changed, 21 insertions(+), 39 deletions(-) diff --git a/src/auto-reply/reply/reply-utils.test.ts b/src/auto-reply/reply/reply-utils.test.ts index 88f092bf1e5..fc499e93676 100644 --- a/src/auto-reply/reply/reply-utils.test.ts +++ b/src/auto-reply/reply/reply-utils.test.ts @@ -158,10 +158,10 @@ describe("normalizeReplyPayload", () => { expect(result).not.toBeNull(); expect(result!.text).toBe("hello [[slack_buttons: Retry:retry, Ignore:ignore]]"); - expect(result!.channelData).toBeUndefined(); + expect(result!.interactive).toBeUndefined(); }); - it("applies responsePrefix before compiling Slack directives into blocks", () => { + it("applies responsePrefix before compiling Slack directives into shared interactive blocks", () => { const result = normalizeReplyPayload( { text: "hello [[slack_buttons: Retry:retry, Ignore:ignore]]", @@ -171,44 +171,26 @@ describe("normalizeReplyPayload", () => { expect(result).not.toBeNull(); expect(result!.text).toBe("[bot] hello"); - expect(result!.channelData).toEqual({ - slack: { - blocks: [ - { - type: "section", - text: { - type: "mrkdwn", - text: "[bot] hello", + expect(result!.interactive).toEqual({ + blocks: [ + { + type: "text", + text: "[bot] hello", + }, + { + type: "buttons", + buttons: [ + { + label: "Retry", + value: "retry", }, - }, - { - type: "actions", - block_id: "openclaw_reply_buttons_1", - elements: [ - { - type: "button", - action_id: "openclaw:reply_button", - text: { - type: "plain_text", - text: "Retry", - emoji: true, - }, - value: "reply_1_retry", - }, - { - type: "button", - action_id: "openclaw:reply_button", - text: { - type: "plain_text", - text: "Ignore", - emoji: true, - }, - value: "reply_2_ignore", - }, - ], - }, - ], - }, + { + label: "Ignore", + value: "ignore", + }, + ], + }, + ], }); }); });