test: follow the camera panel presentation owner

This commit is contained in:
Sameh Khamis committed 2026-09-13 00:45:35 -07:00
1 parent 4298fb0442
commit c6ac74c242
1 file changed
+4 -4
+4 -4
View File
@@ -67,8 +67,8 @@ import {
activateCctvCameraFromWorldClick,
} from '../cctvFocusRequest.js';
const UI_SOURCE = fs.readFileSync(
path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'ui.js'),
const CCTV_PRESENTATION_SOURCE = fs.readFileSync(
path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'ui', 'cctvPresentation.js'),
'utf8',
);
@@ -931,10 +931,10 @@ test('CCTV null-active coverage, auto-hop, cycling, and panel targets stay hones
assert.equal(cctvCycleIndex(2, 1, records.length), 0);
assert.equal(cctvCycleIndex(0, -1, records.length), records.length - 1);
const renderer = UI_SOURCE.match(/_renderCctvState\(state\) \{[\s\S]*?\n \}\n/);
const renderer = CCTV_PRESENTATION_SOURCE.match(/_renderCctvState\(state\) \{[\s\S]*?\n\}\n/);
assert.ok(renderer, '_renderCctvState is missing');
assert.match(renderer[0], /else if \(!activeId\)[\s\S]*?selectedIndex = -1/);
assert.match(renderer[0], /_cctvFocusBtn\.disabled = !enabled \|\| cameras\.length === 0 \|\| !activeId/);
assert.match(renderer[0], /_cctvFocusBtn\.disabled\s*=\s*!enabled\s*\|\|\s*cameras\.length === 0\s*\|\|\s*!activeId/);
} finally {
cctvLayer.setParams({ autoHop: false });
_setCctvOverlayHostForTest();