fix: cover channels.modelByChannel validation/auto-enable
This commit is contained in:
@@ -147,6 +147,21 @@ describe("config plugin validation", () => {
|
||||
expect(res.ok).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts channels.modelByChannel", async () => {
|
||||
const home = await createCaseHome();
|
||||
const res = validateInHome(home, {
|
||||
agents: { list: [{ id: "pi" }] },
|
||||
channels: {
|
||||
modelByChannel: {
|
||||
openai: {
|
||||
whatsapp: "openai/gpt-5.2",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(res.ok).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts plugin heartbeat targets", async () => {
|
||||
const home = await createCaseHome();
|
||||
const pluginDir = path.join(home, "bluebubbles-plugin");
|
||||
|
||||
@@ -16,6 +16,25 @@ describe("applyPluginAutoEnable", () => {
|
||||
expect(result.changes.join("\n")).toContain("Slack configured, enabled automatically.");
|
||||
});
|
||||
|
||||
it("ignores channels.modelByChannel for plugin auto-enable", () => {
|
||||
const result = applyPluginAutoEnable({
|
||||
config: {
|
||||
channels: {
|
||||
modelByChannel: {
|
||||
openai: {
|
||||
whatsapp: "openai/gpt-5.2",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
env: {},
|
||||
});
|
||||
|
||||
expect(result.config.plugins?.entries?.modelByChannel).toBeUndefined();
|
||||
expect(result.config.plugins?.allow).toBeUndefined();
|
||||
expect(result.changes).toEqual([]);
|
||||
});
|
||||
|
||||
it("respects explicit disable", () => {
|
||||
const result = applyPluginAutoEnable({
|
||||
config: {
|
||||
|
||||
Reference in New Issue
Block a user