mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
The camera starts with the whole Earth in view, looking straight down, instead of flying in to Austin. A shared link flies on from there. A different start, a city for instance, is set with the startView option of createApplicationControls. The Cesium renderer and the test stub now start from the same pose, so state that carries over from the first frames (screen clusters, marker selection, label placement) no longer depends on which of them drew it.
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
import test, { after, before } from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import '../testSupport/stubMgrs.mjs';
|
|
import { installVueDom } from '../testSupport/vueDom.mjs';
|
|
import { bindFakeCesiumCamera } from '../testSupport/fakeCameraPort.mjs';
|
|
|
|
const { createApplicationControls } = await import('./controls.js');
|
|
|
|
let uninstallDom;
|
|
before(() => {
|
|
uninstallDom = installVueDom();
|
|
});
|
|
after(() => uninstallDom());
|
|
|
|
test('the application controls start and stop', () => {
|
|
class Controls {
|
|
hasShareState = true;
|
|
orbitController = { stop() {} };
|
|
hud = { destroy() {} };
|
|
dispose() {}
|
|
}
|
|
const cleanups = [];
|
|
createApplicationControls({
|
|
scene: {
|
|
viewer: bindFakeCesiumCamera({
|
|
isDestroyed: () => false,
|
|
camera: { setView() {} },
|
|
}),
|
|
mapStackController: {},
|
|
operations: {
|
|
surface: { controlServices: {} },
|
|
searchAndFlyTo() {},
|
|
requests: { regional: {}, weather: {} },
|
|
},
|
|
},
|
|
loaderStatus: {},
|
|
Controls,
|
|
catalog: { get: (id) => ({ id }) },
|
|
defer: (cleanup) => cleanups.push(cleanup),
|
|
});
|
|
for (const cleanup of cleanups.reverse()) cleanup();
|
|
});
|