test: use synthetic auto reply fixtures

This commit is contained in:
Peter Steinberger
2026-04-21 01:48:34 +01:00
parent 32e8bca02c
commit a112903802
8 changed files with 20 additions and 20 deletions

View File

@@ -85,7 +85,7 @@ describe("acp stream settings", () => {
it("resolves chunking/coalescing from ACP stream controls", () => {
const streaming = resolveAcpStreamingConfig({
cfg: createAcpTestConfig(),
provider: "discord",
provider: "quietchat",
});
expect(streaming.chunking.maxChars).toBe(64);
expect(streaming.coalescing.idleMs).toBe(0);
@@ -103,7 +103,7 @@ describe("acp stream settings", () => {
},
},
}),
provider: "discord",
provider: "quietchat",
deliveryMode: "live",
});
expect(streaming.chunking.minChars).toBe(1);

View File

@@ -84,8 +84,8 @@ function makeParams(): HandleCommandsParams {
isAuthorizedSender: true,
senderIsOwner: true,
senderId: "sender-1",
channel: "telegram",
surface: "telegram",
channel: "quietchat",
surface: "quietchat",
ownerList: [],
rawBodyNormalized: "/export-session",
},

View File

@@ -292,8 +292,8 @@ function buildSessionCommandParams(
CommandBody: commandBody,
CommandSource: "text",
CommandAuthorized: true,
Provider: "whatsapp",
Surface: "whatsapp",
Provider: "quietchat",
Surface: "quietchat",
From: "+1222",
To: "+1222",
SenderId: "user-1",

View File

@@ -38,7 +38,7 @@ describe("subagents info", () => {
it("returns usage for missing targets", () => {
const cfg = {
commands: { text: true },
channels: { whatsapp: { allowFrom: ["*"] } },
channels: { quietchat: { allowFrom: ["*"] } },
} as OpenClawConfig;
const result = handleSubagentsInfoAction(buildInfoContext({ cfg, runs: [], restTokens: [] }));
expect(result.shouldContinue).toBe(false);
@@ -175,7 +175,7 @@ describe("subagents info", () => {
});
const cfg = {
commands: { text: true },
channels: { whatsapp: { allowFrom: ["*"] } },
channels: { quietchat: { allowFrom: ["*"] } },
session: { mainKey: "main", scope: "per-sender" },
} as OpenClawConfig;
const result = handleSubagentsInfoAction({

View File

@@ -8,7 +8,7 @@ describe("maybeHandleQueueDirective", () => {
const invalid = maybeHandleQueueDirective({
directives: parseInlineDirectives("/queue collect debounce:bogus cap:zero drop:maybe"),
cfg: {} as OpenClawConfig,
channel: "whatsapp",
channel: "quietchat",
});
expect(invalid?.text).toContain("Invalid debounce");
expect(invalid?.text).toContain("Invalid cap");
@@ -26,7 +26,7 @@ describe("maybeHandleQueueDirective", () => {
},
},
} as OpenClawConfig,
channel: "whatsapp",
channel: "quietchat",
});
expect(current?.text).toContain(
"Current queue settings: mode=collect, debounce=1500ms, cap=9, drop=summarize.",

View File

@@ -8,19 +8,19 @@ import {
describe("origin-routing helpers", () => {
it("prefers originating channel over provider for message provider", () => {
const provider = resolveOriginMessageProvider({
originatingChannel: "Telegram",
originatingChannel: "QuietChat",
provider: "heartbeat",
});
expect(provider).toBe("telegram");
expect(provider).toBe("quietchat");
});
it("falls back to provider when originating channel is missing", () => {
const provider = resolveOriginMessageProvider({
provider: " Slack ",
provider: " WorkChat ",
});
expect(provider).toBe("slack");
expect(provider).toBe("workchat");
});
it("prefers originating destination over fallback destination", () => {

View File

@@ -55,8 +55,8 @@ describe("initSessionState - heartbeat should not trigger session reset", () =>
From: "user123",
To: "bot123",
SessionKey: "main:user123",
Provider: "telegram",
Surface: "telegram",
Provider: "quietchat",
Surface: "quietchat",
ChatType: "direct",
CommandAuthorized: true,
...overrides,
@@ -107,7 +107,7 @@ describe("initSessionState - heartbeat should not trigger session reset", () =>
const cfg = createBaseConfig();
const ctx = createBaseCtx({
Provider: "telegram", // Regular provider - SHOULD trigger reset if stale
Provider: "quietchat", // Regular provider - SHOULD trigger reset if stale
Body: "test message",
});

View File

@@ -28,7 +28,7 @@ describe("resolveRunTypingPolicy", () => {
const resolved = resolveRunTypingPolicy({
requestedPolicy: "user_message",
systemEvent: true,
originatingChannel: "telegram",
originatingChannel: "quietchat",
});
expect(resolved).toEqual({
typingPolicy: "system_event",
@@ -39,7 +39,7 @@ describe("resolveRunTypingPolicy", () => {
it("preserves requested policy for regular user turns", () => {
const resolved = resolveRunTypingPolicy({
requestedPolicy: "user_message",
originatingChannel: "telegram",
originatingChannel: "quietchat",
});
expect(resolved).toEqual({
typingPolicy: "user_message",
@@ -50,7 +50,7 @@ describe("resolveRunTypingPolicy", () => {
it("respects explicit suppressTyping", () => {
const resolved = resolveRunTypingPolicy({
requestedPolicy: "auto",
originatingChannel: "telegram",
originatingChannel: "quietchat",
suppressTyping: true,
});
expect(resolved).toEqual({