mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 02:14:01 +00:00
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:
1 parent
c62e580d7e
commit
af79691a19
2 files changed
+23
-24
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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° ·/);
|
||||
});
|
||||
Reference in new issue
Block a user