Support config-driven output formatting

This commit is contained in:
Rene De Ren
2026-03-12 16:13:39 +01:00
parent 31928fd124
commit 814ee3d763
6 changed files with 135 additions and 51 deletions

View File

@@ -79,6 +79,7 @@ describe('ConfigManager', () => {
const result = cm.buildConfig('measurement', uiConfig, 'node-id-1');
expect(result).toHaveProperty('general');
expect(result).toHaveProperty('functionality');
expect(result).toHaveProperty('output');
});
it('should populate general.name from uiConfig.name', () => {
@@ -168,6 +169,25 @@ describe('ConfigManager', () => {
expect(result).toHaveProperty('general');
expect(result).toHaveProperty('functionality');
});
it('should default output formats to process and influxdb', () => {
const result = cm.buildConfig('measurement', {}, 'id-1');
expect(result.output).toEqual({
process: 'process',
dbase: 'influxdb',
});
});
it('should allow output format overrides from ui config', () => {
const result = cm.buildConfig('measurement', {
processOutputFormat: 'json',
dbaseOutputFormat: 'csv',
}, 'id-1');
expect(result.output).toEqual({
process: 'json',
dbase: 'csv',
});
});
});
// ── createEndpoint() ─────────────────────────────────────────────────