fix(config): align whatsapp enabled schema with auto-enable

This commit is contained in:
Peter Steinberger
2026-02-24 03:39:25 +00:00
parent aef45b2abb
commit 3a653082d8
5 changed files with 34 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
import { describe, expect, it } from "vitest";
import { validateConfigObject } from "./config.js";
import { applyPluginAutoEnable } from "./plugin-auto-enable.js";
describe("applyPluginAutoEnable", () => {
@@ -48,6 +49,23 @@ describe("applyPluginAutoEnable", () => {
expect(result.changes).toEqual([]);
});
it("keeps auto-enabled WhatsApp config schema-valid", () => {
const result = applyPluginAutoEnable({
config: {
channels: {
whatsapp: {
allowFrom: ["+15555550123"],
},
},
},
env: {},
});
expect(result.config.channels?.whatsapp?.enabled).toBe(true);
const validated = validateConfigObject(result.config);
expect(validated.ok).toBe(true);
});
it("respects explicit disable", () => {
const result = applyPluginAutoEnable({
config: {