mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-01 12:21:25 +00:00
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { OpenClawConfig } from "../runtime-api.js";
|
|
import { resolveMattermostGroupRequireMention } from "./group-mentions.js";
|
|
|
|
describe("resolveMattermostGroupRequireMention", () => {
|
|
it("defaults to requiring mention when no override is configured", () => {
|
|
const cfg: OpenClawConfig = {
|
|
channels: {
|
|
mattermost: {},
|
|
},
|
|
};
|
|
|
|
const requireMention = resolveMattermostGroupRequireMention({ cfg, accountId: "default" });
|
|
expect(requireMention).toBe(true);
|
|
});
|
|
|
|
it("respects chatmode-derived account override", () => {
|
|
const cfg: OpenClawConfig = {
|
|
channels: {
|
|
mattermost: {
|
|
chatmode: "onmessage",
|
|
},
|
|
},
|
|
};
|
|
|
|
const requireMention = resolveMattermostGroupRequireMention({ cfg, accountId: "default" });
|
|
expect(requireMention).toBe(false);
|
|
});
|
|
|
|
it("prefers an explicit runtime override when provided", () => {
|
|
const cfg: OpenClawConfig = {
|
|
channels: {
|
|
mattermost: {
|
|
chatmode: "oncall",
|
|
},
|
|
},
|
|
};
|
|
|
|
const requireMention = resolveMattermostGroupRequireMention({
|
|
cfg,
|
|
accountId: "default",
|
|
requireMentionOverride: false,
|
|
});
|
|
expect(requireMention).toBe(false);
|
|
});
|
|
});
|