test: verify plugin warning messages

This commit is contained in:
Shakker
2026-05-11 16:40:05 +01:00
parent b0db82be15
commit 561c19cb58
3 changed files with 18 additions and 13 deletions

View File

@@ -123,16 +123,23 @@ describe("irc inbound behavior", () => {
expect(sendReply).toHaveBeenCalledTimes(1);
expect(sendReply).toHaveBeenCalledWith(
"alice",
expect.stringContaining("OpenClaw: access not configured."),
[
"OpenClaw: access not configured.",
"",
"Your IRC id: alice!ident@example.com",
"Pairing code:",
"```",
"CODE",
"```",
"",
"Ask the bot owner to approve with:",
"openclaw pairing approve irc CODE",
"```",
"openclaw pairing approve irc CODE",
"```",
].join("\n"),
undefined,
);
expect(sendReply).toHaveBeenCalledWith(
"alice",
expect.stringContaining("Your IRC id: alice!ident@example.com"),
undefined,
);
const replyMessages = sendReply.mock.calls.map((call) => call[1]);
expect(replyMessages.some((message) => message.includes("CODE"))).toBe(true);
});
it("drops unauthorized group control commands before dispatch", async () => {