openclaw/extensions/zalo/src/channel.directory.test.ts
Vj a0ea122d92 chore: full rebrand clawdbot -> moltbot
- Replace all CLAWDBOT_* env vars with MOLTBOT_*
- Replace all .clawdbot paths with .moltbot
- Update daemon labels to bot.molt.*
- Update plugin SDK imports to moltbot/plugin-sdk
- Remove clawdbot bin alias from package.json
- Preserve legacy compatibility in compat/legacy-names.ts
2026-01-29 11:24:27 +00:00

36 lines
1.0 KiB
TypeScript

import { describe, expect, it } from "vitest";
import type { MoltbotConfig } from "moltbot/plugin-sdk";
import { zaloPlugin } from "./channel.js";
describe("zalo directory", () => {
it("lists peers from allowFrom", async () => {
const cfg = {
channels: {
zalo: {
allowFrom: ["zalo:123", "zl:234", "345"],
},
},
} as unknown as MoltbotConfig;
expect(zaloPlugin.directory).toBeTruthy();
expect(zaloPlugin.directory?.listPeers).toBeTruthy();
expect(zaloPlugin.directory?.listGroups).toBeTruthy();
await expect(
zaloPlugin.directory!.listPeers({ cfg, accountId: undefined, query: undefined, limit: undefined }),
).resolves.toEqual(
expect.arrayContaining([
{ kind: "user", id: "123" },
{ kind: "user", id: "234" },
{ kind: "user", id: "345" },
]),
);
await expect(zaloPlugin.directory!.listGroups({ cfg, accountId: undefined, query: undefined, limit: undefined })).resolves.toEqual(
[],
);
});
});