refactor: dedupe cli config cron and install flows

This commit is contained in:
Peter Steinberger
2026-03-02 19:48:38 +00:00
parent 9d30159fcd
commit b1c30f0ba9
80 changed files with 1379 additions and 2027 deletions

View File

@@ -50,11 +50,9 @@ describe("normalizePluginsConfig", () => {
});
describe("resolveEffectiveEnableState", () => {
it("enables bundled channels when channels.<id>.enabled=true", () => {
const normalized = normalizePluginsConfig({
enabled: true,
});
const state = resolveEffectiveEnableState({
function resolveBundledTelegramState(config: Parameters<typeof normalizePluginsConfig>[0]) {
const normalized = normalizePluginsConfig(config);
return resolveEffectiveEnableState({
id: "telegram",
origin: "bundled",
config: normalized,
@@ -66,11 +64,17 @@ describe("resolveEffectiveEnableState", () => {
},
},
});
}
it("enables bundled channels when channels.<id>.enabled=true", () => {
const state = resolveBundledTelegramState({
enabled: true,
});
expect(state).toEqual({ enabled: true });
});
it("keeps explicit plugin-level disable authoritative", () => {
const normalized = normalizePluginsConfig({
const state = resolveBundledTelegramState({
enabled: true,
entries: {
telegram: {
@@ -78,18 +82,6 @@ describe("resolveEffectiveEnableState", () => {
},
},
});
const state = resolveEffectiveEnableState({
id: "telegram",
origin: "bundled",
config: normalized,
rootConfig: {
channels: {
telegram: {
enabled: true,
},
},
},
});
expect(state).toEqual({ enabled: false, reason: "disabled in config" });
});
});