mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
fix(air-quality): a double-click follows a station again
The stations were entities, which the default renderer's double-click followed, framed to fit the disc; one no longer reported took the follow with it. As draw-port items they took no part in it.
This commit is contained in:
1 parent
fbc40ef3b6
commit
37a1e1500b
2 files changed
+71
-2
No files matched your search
@@ -322,3 +322,35 @@ test('a failed refresh over good readings reports degraded, not nominal', async
|
||||
'showing old data after a failure is degraded',
|
||||
);
|
||||
});
|
||||
|
||||
test('a double-click follows a station until it is no longer reported, as its entity was', async (t) => {
|
||||
const { bindRenderer } = await import('../../render/rendererOf.js');
|
||||
const { createStubRenderer } = await import('../../render/stub/index.js');
|
||||
const renderer = createStubRenderer();
|
||||
const viewer = { isDestroyed: () => false };
|
||||
const unbind = bindRenderer(viewer, renderer);
|
||||
let rows = [reading('a', 12)];
|
||||
const layer = createAirQualityLayer({
|
||||
source: { getSnapshot: async () => rows },
|
||||
overlayHost: { setEntries() {}, setVisible() {}, clearSource() {} },
|
||||
});
|
||||
t.after(() => {
|
||||
layer.destroy();
|
||||
unbind();
|
||||
renderer.destroy();
|
||||
});
|
||||
layer.init(viewer);
|
||||
layer.enable();
|
||||
await layer.update();
|
||||
const set = renderer.testing
|
||||
.sets()
|
||||
.find((id) => id.startsWith('air-quality'));
|
||||
renderer.testing.scriptPicks(() => [
|
||||
{ set, id: 'air-quality:eccc:a', surface: false },
|
||||
]);
|
||||
renderer.testing.pointer('dblclick', 10, 10);
|
||||
assert.ok(renderer.camera.followed, 'the station is followed');
|
||||
rows = [reading('b', 12)];
|
||||
await layer.update();
|
||||
assert.equal(renderer.camera.followed, null, 'gone: not followed');
|
||||
});
|
||||
Reference in new issue
Block a user