refactor: dedupe cli config cron and install flows
This commit is contained in:
@@ -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" });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user