Skip to content

A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.

test: wait for destination traffic after camera changes

Sameh Khamis9e27a0e7cd4a
diff --git a/scripts/qa-traffic.mjs b/scripts/qa-traffic.mjs
index 38382f8c4..2a04d5595 100644
--- a/scripts/qa-traffic.mjs
+++ b/scripts/qa-traffic.mjs
@@ -85,6 +85,7 @@ async function settleTraffic(page, view, { minCount = 1, timeoutS = 30 } = {}) {
const dm = gev.dataManager;
await dm.setEnabled('traffic', true);
const mod = dm.layers.get('traffic').module;
+ const beforeUpdate = mod.getStats().lastUpdate;
const ell = gev.viewer.scene.globe.ellipsoid;
const d2r = Math.PI / 180;
// The app's intro flyTo animation clobbers a setView issued mid-flight —
@@ -98,7 +99,9 @@ async function settleTraffic(page, view, { minCount = 1, timeoutS = 30 } = {}) {
for (let i = 0; i < tS; i++) {
await new Promise((r) => setTimeout(r, 1000));
s = mod.getStats();
- if (s.count >= minC && !s.loading) break;
+ // Retained roads from the previous city can satisfy count/loading before
+ // the move debounce starts its request. Require the destination render.
+ if (s.lastUpdate !== beforeUpdate && s.count >= minC && !s.loading) break;
}
return s;
}, view, minCount, timeoutS);