mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 12:21:24 +00:00
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import "./test-helpers.js";
|
|
import { describe, expect, it } from "vitest";
|
|
import type { OpenClawConfig } from "../config/config.js";
|
|
import { sendWebDirectInboundAndCollectSessionKeys } from "./auto-reply.broadcast-groups.test-harness.js";
|
|
import {
|
|
installWebAutoReplyTestHomeHooks,
|
|
installWebAutoReplyUnitTestHooks,
|
|
resetLoadConfigMock,
|
|
setLoadConfigMock,
|
|
} from "./auto-reply.test-harness.js";
|
|
|
|
installWebAutoReplyTestHomeHooks();
|
|
|
|
describe("broadcast groups", () => {
|
|
installWebAutoReplyUnitTestHooks();
|
|
|
|
it("skips unknown broadcast agent ids when agents.list is present", async () => {
|
|
setLoadConfigMock({
|
|
channels: { whatsapp: { allowFrom: ["*"] } },
|
|
agents: {
|
|
defaults: { maxConcurrent: 10 },
|
|
list: [{ id: "alfred" }],
|
|
},
|
|
broadcast: {
|
|
"+1000": ["alfred", "missing"],
|
|
},
|
|
} satisfies OpenClawConfig);
|
|
|
|
const { seen, resolver } = await sendWebDirectInboundAndCollectSessionKeys();
|
|
|
|
expect(resolver).toHaveBeenCalledTimes(1);
|
|
expect(seen[0]).toContain("agent:alfred:");
|
|
resetLoadConfigMock();
|
|
});
|
|
});
|