diff --git a/src/ui/cctvControls.test.mjs b/src/ui/cctvControls.test.mjs index 5389bf0f4..9a5d746d7 100644 --- a/src/ui/cctvControls.test.mjs +++ b/src/ui/cctvControls.test.mjs @@ -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); diff --git a/src/ui/cctvPanel.test.mjs b/src/ui/cctvPanel.test.mjs index 1675d6119..a3dbef786 100644 --- a/src/ui/cctvPanel.test.mjs +++ b/src/ui/cctvPanel.test.mjs @@ -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° ·/); +});