fix: Unparseable config when using the low-performance profile (#1570)
* The `low-performance` profile itself had parse errors: fix them! * Do not silently swallow override parse errors, they are always a user issue * Minor error message rendering improvements to show multiple pieces of context
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { expect, it } from 'vitest';
|
||||
import { SCRUBBING_PROFILE } from '../../../src/config/profiles/scrubbing';
|
||||
import { setProfiles } from '../../../src/config/profiles';
|
||||
import { frigateCardConfigSchema } from '../../../src/config/types';
|
||||
import { createRawConfig } from '../../test-utils';
|
||||
|
||||
it('scrubbing profile', () => {
|
||||
it('should contain expected defaults', () => {
|
||||
expect(SCRUBBING_PROFILE).toEqual({
|
||||
'live.controls.timeline.mode': 'below',
|
||||
'live.controls.timeline.style': 'ribbon',
|
||||
@@ -11,3 +14,14 @@ it('scrubbing profile', () => {
|
||||
'media_viewer.controls.timeline.pan_mode': 'seek',
|
||||
});
|
||||
});
|
||||
|
||||
it('should be parseable after application', () => {
|
||||
const rawInputConfig = createRawConfig();
|
||||
const parsedConfig = frigateCardConfigSchema.parse(rawInputConfig);
|
||||
|
||||
setProfiles(rawInputConfig, parsedConfig, ['low-performance']);
|
||||
|
||||
// Reparse the config to ensure the profile did not introduce errors.
|
||||
const parseResult = frigateCardConfigSchema.safeParse(parsedConfig);
|
||||
expect(parseResult.success, parseResult.error?.toString()).toBeTruthy();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user