mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +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
@@ -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