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

@@ -909,7 +909,7 @@ describe("drive.notice.comment_add_v1 monitor handler", () => {
"default",
);
expect(lastRuntime?.error).toHaveBeenCalledWith(
expect.stringContaining("error handling drive comment notice: Error: post-send failure"),
"feishu[default]: error handling drive comment notice: Error: post-send failure",
);
});
const [recordedMessageId, recordedNamespace, recordedLogger] =
@@ -936,9 +936,7 @@ describe("drive.notice.comment_add_v1 monitor handler", () => {
"default",
);
expect(lastRuntime?.error).toHaveBeenCalledWith(
expect.stringContaining(
"error handling drive comment notice: FeishuRetryableSyntheticEventError: retry me",
),
"feishu[default]: error handling drive comment notice: FeishuRetryableSyntheticEventError: retry me",
);
});
});

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 () => {

View File

@@ -142,7 +142,7 @@ describe("runMatrixStartupMaintenance", () => {
expectWarningOnlyMaintenanceSkipped(harness);
expect(harness.log.warn).toHaveBeenCalledWith(
expect.stringContaining("could not be resolved yet"),
`matrix: Legacy Matrix state detected at ${path.join(home, ".openclaw", "matrix")}, but the new account-scoped target could not be resolved yet (need homeserver, userId, and access token for channels.matrix). Start the gateway once with a working Matrix login, or rerun "openclaw doctor --fix" after cached credentials are available.`,
);
});
});