mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 07:42:23 +00:00
test(qa): sprite and enrichment checks on both engines through the probe
The QA probe gains drawn(layerId): what a layer draws per object (glyph
image, scale, shown, screen rotation, alpha, position; its 3D model's
scale, shown, ready), from the flights layer's qaDrawn(), which reads the
renderer's handles, so it is the same on every engine.
qa-sprites-b5 and qa-enrich-ambient take --engine=cesium|navara: without a
viewer they read the layer through the probe and move the engine camera;
the military rows/cluster are skipped where the engine has no military
layer. Cesium verdicts unchanged (sprites 9/9; enrich 9/2, the same E8/E10
failures as on 7c7422e2); Navara: sprites 7/7 (flights rows and 3D cluster),
enrich 9/2 (the same two). Task 10b, checklist item 7.
This commit is contained in:
1 parent
03a0ff3a01
commit
132a941e9a
5 files changed
+135
-46
No files matched your search
@@ -11,6 +11,8 @@
|
||||
// plain { x, y, z }, screen a window point or null)
|
||||
// screenOf(id, objectId) the window point of one object, or null
|
||||
// selected(id) the layer's tracked/selected info, or null
|
||||
// drawn(id) what the layer draws per object (glyph, model),
|
||||
// as plain data, or null (layers with qaDrawn)
|
||||
// following() { label, native } of engine.camera.following()
|
||||
// movers() engine.movers.list()
|
||||
// framesDrawn() frames drawn since the probe started
|
||||
@@ -67,6 +69,7 @@ export function createQaProbe({ engine, dataManager, availability }) {
|
||||
return row ? screenOf(row.position) : null;
|
||||
},
|
||||
selected: (layerId) => moduleOf(layerId)?.getTrackedInfo?.() ?? null,
|
||||
drawn: (layerId) => moduleOf(layerId)?.qaDrawn?.() ?? null,
|
||||
following() {
|
||||
const handle = engine.camera.following();
|
||||
if (!handle) return null;
|
||||
|
||||
@@ -809,6 +809,52 @@ export function createQueries({
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* What this layer draws, as plain data (QA: the engine-neutral probe,
|
||||
* window.__godsEyeView.layers.drawn): per contact its glyph (image,
|
||||
* scale, shown, screen rotation, alpha, position) and its 3D model, read
|
||||
* from the renderer's handles — the same on every engine.
|
||||
* @returns {Array<object>}
|
||||
*/
|
||||
qaDrawn() {
|
||||
const out = [];
|
||||
for (const [id, sprite] of flightState._billboards) {
|
||||
const model = flightState._models.get(id);
|
||||
out.push({
|
||||
id,
|
||||
tracked: id === flightState._trackedIcao,
|
||||
image: sprite.image,
|
||||
scale: sprite.scale,
|
||||
width: sprite.width,
|
||||
show: sprite.show,
|
||||
rotation: sprite.rotation,
|
||||
alpha: sprite.color?.alpha ?? null,
|
||||
position: sprite.position
|
||||
? {
|
||||
x: sprite.position.x,
|
||||
y: sprite.position.y,
|
||||
z: sprite.position.z,
|
||||
}
|
||||
: null,
|
||||
model: model
|
||||
? { scale: model.scale, show: model.show, ready: model.ready }
|
||||
: null,
|
||||
});
|
||||
}
|
||||
const tracked = flightState._trackedModel;
|
||||
if (flightState._trackedIcao && tracked)
|
||||
out.push({
|
||||
id: flightState._trackedIcao,
|
||||
trackedModel: true,
|
||||
model: {
|
||||
scale: tracked.scale,
|
||||
show: tracked.show,
|
||||
ready: tracked.ready,
|
||||
},
|
||||
});
|
||||
return out;
|
||||
},
|
||||
|
||||
/**
|
||||
* Stop tracking the currently followed aircraft (no-op if none).
|
||||
* @returns {boolean} Always true.
|
||||
|
||||
@@ -291,6 +291,10 @@ test('the flights logic draws and follows on the Navara renderer (fake engine)',
|
||||
'abc123',
|
||||
'def456',
|
||||
]);
|
||||
// What it draws, as the QA probe reads it (the same on every engine).
|
||||
const drawn = layer.qaDrawn();
|
||||
assert.deepEqual(drawn.map((row) => row.id).sort(), ['abc123', 'def456']);
|
||||
assert.ok(drawn.every((row) => row.show && row.image.startsWith('data:')));
|
||||
// A click on a contact selects it; the engine follows with its label.
|
||||
engine.fake.script('pick', () => ({ id: 'def456' }));
|
||||
engine.fake.script('drillPick', () => [{ id: 'def456' }]);
|
||||
|
||||
Reference in new issue
Block a user