import {
installChannelOutboundPayloadContractSuite,
primeChannelOutboundSendMock,
type OutboundPayloadHarnessParams,
} from "openclaw/plugin-sdk/testing"; import { beforeEach, describe, expect, it, vi } from "vitest"; import"./accounts.test-mocks.js"; import"./zalo-js.test-mocks.js"; import type { ReplyPayload } from "../runtime-api.js"; import { zalouserPlugin } from "./channel.js"; import { setZalouserRuntime } from "./runtime.js"; import * as sendModule from "./send.js";
it("treats bare numeric targets as direct chats for backward compatibility", async () => {
mockedSend.mockResolvedValue({ ok: true, messageId: "zlu-d1" });
const result = await zalouserPlugin.outbound!.sendPayload!({
...baseCtx({ text: "hello" }),
to: "987654321",
});
it("preserves provider-native group ids when sending to raw g- targets", async () => {
mockedSend.mockResolvedValue({ ok: true, messageId: "zlu-g-native" });
const result = await zalouserPlugin.outbound!.sendPayload!({
...baseCtx({ text: "hello native group" }),
to: "g-1471383327500481391",
});
it("passes long markdown through once so formatting happens before chunking", async () => { const text = `**${"a".repeat(2501)}**`;
mockedSend.mockResolvedValue({ ok: true, messageId: "zlu-code" });
const result = await zalouserPlugin.outbound!.sendPayload!({
...baseCtx({ text }),
to: "987654321",
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.