Support config-driven output formatting
This commit is contained in:
@@ -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() ─────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user