mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 01:31:08 +00:00
test: stabilize outbound contract helpers
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { expect, it, type Mock, vi } from "vitest";
|
||||
import { beforeEach, expect, it, type Mock, vi } from "vitest";
|
||||
import { createSlackOutboundPayloadHarness } from "../../../extensions/slack/contract-api.js";
|
||||
import { whatsappOutbound } from "../../../extensions/whatsapp/test-api.js";
|
||||
import {
|
||||
@@ -10,6 +10,7 @@ import type { ReplyPayload } from "../../../src/auto-reply/types.js";
|
||||
import { primeChannelOutboundSendMock } from "../../../src/channels/plugins/contracts/test-helpers.js";
|
||||
import { createDirectTextMediaOutbound } from "../../../src/channels/plugins/outbound/direct-text-media.js";
|
||||
import type { ChannelOutboundAdapter } from "../../../src/channels/plugins/types.js";
|
||||
import { resetGlobalHookRunner } from "../../../src/plugins/hook-runner-global.js";
|
||||
import { loadBundledPluginTestApiSync } from "../../../src/test-utils/bundled-plugin-public-surface.js";
|
||||
type ParseZalouserOutboundTarget = (raw: string) => { threadId: string; isGroup: boolean };
|
||||
|
||||
@@ -71,6 +72,10 @@ function installChannelOutboundPayloadContractSuite(params: {
|
||||
to: string;
|
||||
};
|
||||
}) {
|
||||
beforeEach(() => {
|
||||
resetGlobalHookRunner();
|
||||
});
|
||||
|
||||
it("text-only delegates to sendText", async () => {
|
||||
const { run, sendMock, to } = params.createHarness({
|
||||
payload: { text: "hello" },
|
||||
|
||||
Reference in New Issue
Block a user