Update dimensions and media layout options to be per camera.

This commit is contained in:
Dermot Duffy
2024-03-06 23:08:32 -08:00
parent b8e2b3218e
commit 72eae2bf88
20 changed files with 375 additions and 294 deletions
+54
View File
@@ -1738,5 +1738,59 @@ describe('should handle version specific upgrades', () => {
});
});
});
describe('should handle media layout changes', () => {
it('from live.layout to camera_global.dimensions', () => {
const config = {
live: {
layout: {
fit: 'cover',
position: {
x: 42,
y: 43,
},
},
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
live: {},
cameras_global: {
dimensions: {
layout: {
fit: 'cover',
position: {
x: 42,
y: 43,
},
},
},
},
});
});
describe('from delete old media layouts', () => {
it.each([['media_viewer' as const], ['image' as const]])(
'%s',
(section: string) => {
const config = {
[section]: {
layout: {
fit: 'cover',
position: {
x: 42,
y: 43,
},
},
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
[section]: {},
});
},
);
});
});
});
});