





















@@ -268,9 +268,13 @@ describe("sendMessageIrc cfg threading", () => {
268268} as unknown as CoreConfig;
269269const client = {
270270isReady: vi.fn(() => true),
271+join: vi.fn(),
271272sendPrivmsg: vi.fn(),
272273quit: vi.fn(),
273-} as unknown as IrcClient & { quit: ReturnType<typeof vi.fn> };
274+} as unknown as IrcClient & {
275+join: ReturnType<typeof vi.fn>;
276+quit: ReturnType<typeof vi.fn>;
277+};
274278hoisted.connectIrcClient.mockResolvedValue(client);
275279276280const proofResults = await verifyChannelMessageAdapterCapabilityProofs({
@@ -284,6 +288,7 @@ describe("sendMessageIrc cfg threading", () => {
284288text: "hello",
285289});
286290expect(result?.receipt.platformMessageIds).toEqual(["irc-msg-1"]);
291+expect(client.join).toHaveBeenCalledWith("#room");
287292expect(client.sendPrivmsg).toHaveBeenCalledWith("#room", "hello");
288293},
289294media: async () => {
@@ -294,6 +299,7 @@ describe("sendMessageIrc cfg threading", () => {
294299mediaUrl: "https://example.com/image.png",
295300});
296301expect(result?.receipt.platformMessageIds).toEqual(["irc-msg-1"]);
302+expect(client.join).toHaveBeenCalledWith("#room");
297303expect(client.sendPrivmsg).toHaveBeenCalledWith(
298304"#room",
299305"image\n\nAttachment: https://example.com/image.png",
@@ -307,6 +313,7 @@ describe("sendMessageIrc cfg threading", () => {
307313replyToId: "parent-1",
308314});
309315expect(result?.receipt.replyToId).toBe("parent-1");
316+expect(client.join).toHaveBeenCalledWith("#room");
310317expect(client.sendPrivmsg).toHaveBeenCalledWith("#room", "threaded\n\n[reply:parent-1]");
311318},
312319},
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。