feat(setup): skip redundant operator-pack prompts and add strict-mode docs/tests
This commit is contained in:
@@ -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 * * *');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user