Include full contents of all nested repositories

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 16:25:02 +01:00
parent 14ff8fd54c
commit 2401ed446f
7271 changed files with 1310112 additions and 6 deletions

View File

@@ -0,0 +1,66 @@
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk";
import { describe, expect, it } from "vitest";
import { msteamsPlugin } from "./channel.js";
describe("msteams directory", () => {
const runtimeEnv: RuntimeEnv = {
log: () => {},
error: () => {},
exit: (code: number): never => {
throw new Error(`exit ${code}`);
},
};
it("lists peers and groups from config", async () => {
const cfg = {
channels: {
msteams: {
allowFrom: ["alice", "user:Bob"],
dms: { carol: {}, bob: {} },
teams: {
team1: {
channels: {
"conversation:chan1": {},
chan2: {},
},
},
},
},
},
} as unknown as OpenClawConfig;
expect(msteamsPlugin.directory).toBeTruthy();
expect(msteamsPlugin.directory?.listPeers).toBeTruthy();
expect(msteamsPlugin.directory?.listGroups).toBeTruthy();
await expect(
msteamsPlugin.directory!.listPeers!({
cfg,
query: undefined,
limit: undefined,
runtime: runtimeEnv,
}),
).resolves.toEqual(
expect.arrayContaining([
{ kind: "user", id: "user:alice" },
{ kind: "user", id: "user:Bob" },
{ kind: "user", id: "user:carol" },
{ kind: "user", id: "user:bob" },
]),
);
await expect(
msteamsPlugin.directory!.listGroups!({
cfg,
query: undefined,
limit: undefined,
runtime: runtimeEnv,
}),
).resolves.toEqual(
expect.arrayContaining([
{ kind: "group", id: "conversation:chan1" },
{ kind: "group", id: "conversation:chan2" },
]),
);
});
});