feat(setup): skip redundant operator-pack prompts and add strict-mode docs/tests

This commit is contained in:
William Valentin
2026-02-16 15:27:27 -08:00
parent 7ce58f5966
commit dc1c691ea5
6 changed files with 103 additions and 8 deletions
+30
View File
@@ -127,4 +127,34 @@ describe('setupAutomation', () => {
expect(automation?.heartbeat).toBeUndefined();
expect(automation?.minio_sync).toBeUndefined();
});
it('skips operator-pack reconfiguration prompts when already configured and not reconfigured', async () => {
const builder = new ConfigBuilder();
builder.applyOperatorPack({
outputChannel: 'telegram',
outputPeer: '123',
backupSchedule: '0 2 * * *',
dailyBriefingSchedule: '0 8 * * *',
enableMinioSync: true,
});
const p = makePrompter({
confirms: [
false, // reconfigure operator pack?
false, // enable cron scheduler
false, // enable webhook receiver
false, // configure google services
],
});
await setupAutomation(p, builder);
const config = builder.build() as Record<string, unknown>;
const backup = config.backup as Record<string, unknown>;
const automation = config.automation as Record<string, unknown>;
const briefing = automation.daily_briefing as Record<string, unknown>;
expect(backup.schedule).toBe('0 2 * * *');
expect(briefing.schedule).toBe('0 8 * * *');
});
});