test(cctv): check the north-rounding meta line through presentCctvPanel

The panel now renders from the CCTV store, so the meta line is no longer
written to a DOM node by _renderCctvState. Assert on presentCctvPanel's
meta text instead.
This commit is contained in:
Sameh Khamis committed 2026-11-01 20:53:32 -08:00
1 parent c62e580d7e
commit af79691a19
2 files changed
+23 -24

No files matched your search

-24
View File
@@ -47,30 +47,6 @@ function fixture(t) {
return { controls, requests };
}
test('the panel meta line reads a bearing that rounds to north as HDG 0°', (t) => {
const { controls } = fixture(t);
controls.actions.setPanelCollapsed = () => {};
controls._cctvMeta = element();
const meta = (headingDeg) => {
const camera = {
id: 'a',
city: 'Austin',
headingDeg,
fovDeg: 74,
rangeM: 700,
};
controls._renderCctvState({
enabled: true,
activeCameraId: camera.id,
activeCamera: camera,
cameras: [camera],
});
return controls._cctvMeta.textContent;
};
assert.match(meta(359.4), /· HDG 359° ·/);
assert.match(meta(359.6), /· HDG 0° ·/);
});
test('a late image completion cannot replace a newer camera preview', (t) => {
const { controls, requests } = fixture(t);
controls._queueCctvFrame('first.jpg', 'a', true);
+23
View File
@@ -490,3 +490,26 @@ test('the scene summary types in, then holds the whole text', async (t) => {
await nextTick();
assert.equal(byId('cctv-summary').textContent, text);
});
test('the panel meta line reads a bearing that rounds to north as HDG 0°', () => {
const meta = (headingDeg) => {
const camera = {
id: 'a',
city: 'Austin',
headingDeg,
fovDeg: 74,
rangeM: 700,
};
return presentCctvPanel(
{
enabled: true,
activeCameraId: camera.id,
activeCamera: camera,
cameras: [camera],
},
true,
).meta;
};
assert.match(meta(359.4), /· HDG 359° ·/);
assert.match(meta(359.6), /· HDG 0° ·/);
});