mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:00:43 +00:00
Merged via squash.
Prepared head SHA: fd5fc06007
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
30 lines
811 B
TypeScript
30 lines
811 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveMatrixGroupToolPolicy } from "./group-mentions.js";
|
|
|
|
describe("Matrix group policy", () => {
|
|
it("resolves room tool policy from the case-preserved Matrix room id", () => {
|
|
const policy = resolveMatrixGroupToolPolicy({
|
|
accountId: "default",
|
|
cfg: {
|
|
channels: {
|
|
matrix: {
|
|
accounts: {
|
|
default: {
|
|
groups: {
|
|
"!RoomABC:example.org": {
|
|
tools: { allow: ["sessions_spawn"] },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
groupId: "!roomabc:example.org",
|
|
groupChannel: "!RoomABC:example.org",
|
|
});
|
|
|
|
expect(policy).toEqual({ allow: ["sessions_spawn"] });
|
|
});
|
|
});
|