fix(config): reject reserved ingest connection ids

This commit is contained in:
Andrey Avtomonov 2026-05-13 18:36:12 +02:00
parent ca61f3e08e
commit 23dba892cd
9 changed files with 132 additions and 10 deletions

View file

@ -1175,6 +1175,18 @@ describe('runKtxCli', () => {
);
});
it('rejects reserved setup database connection ids before dispatch', async () => {
const testIo = makeIo();
const setup = vi.fn(async () => 0);
await expect(
runKtxCli(['setup', '--new-database-connection-id', 'status', '--no-input'], testIo.io, { setup }),
).resolves.toBe(1);
expect(setup).not.toHaveBeenCalled();
expect(testIo.stderr()).toContain('"status" is reserved for ktx ingest status; choose a different connection id.');
});
it('dispatches setup source flags', async () => {
const setup = vi.fn(async () => 0);
const testIo = makeIo();