feat: improve consumer-facing flow and payload helper / 改善可直接使用流程與 Telegram payload helper
This commit is contained in:
11
tests/telegram-outbound-payload.test.mjs
Normal file
11
tests/telegram-outbound-payload.test.mjs
Normal file
@@ -0,0 +1,11 @@
|
||||
import test from "node:test"
|
||||
import assert from "node:assert/strict"
|
||||
|
||||
import { buildTelegramReplyEndPayload } from "../src/telegram/outbound-payload.ts"
|
||||
|
||||
test("buildTelegramReplyEndPayload returns text plus default reply-end buttons", () => {
|
||||
const payload = buildTelegramReplyEndPayload("hello")
|
||||
assert.equal(payload.text, "hello")
|
||||
assert.equal(payload.buttons[0][0].callback_data, "rec:continue")
|
||||
assert.equal(payload.buttons[0][1].callback_data, "rec:stop")
|
||||
})
|
||||
Reference in New Issue
Block a user