mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-12 06:12:18 +00:00
test(cockpit): the real vessel layer keeps the ridden ship on a water click
The bridge tests drive a hand-written layer, so nothing exercised the vessel layer's own scene-click gate. A wire test now clicks open water with the bridge holding the ship, then again after release. The Contacts test that adopts Live AIS Vessels directly is renamed to say so: it never rides a bridge.
This commit is contained in:
1 parent
9abc105266
commit
0ba7ba6512
2 files changed
+17
-1
No files matched your search
@@ -989,6 +989,22 @@ test('vessel interaction wire: trail pick does not deselect', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('vessel interaction wire: a click on open water keeps the ship the bridge rides', () => {
|
||||||
|
const harness = installWireHarness({ id: 'gev-trailing-contact' });
|
||||||
|
try {
|
||||||
|
aisLiveVesselsLayer.setCockpitSubject(harness.record.mmsi);
|
||||||
|
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||||
|
assert.equal(aisLiveVesselsLayer.getSelectedInfo()?.mmsi, harness.record.mmsi);
|
||||||
|
assert.equal(harness.trail.clearCalls, 0);
|
||||||
|
// Released, the same click deselects as it always has.
|
||||||
|
aisLiveVesselsLayer.setCockpitSubject(null);
|
||||||
|
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||||
|
assert.equal(aisLiveVesselsLayer.getSelectedInfo(), null);
|
||||||
|
} finally {
|
||||||
|
harness.cleanup();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test('vessel interaction wire: only the gev-trail: namespace receives the trail no-op', () => {
|
test('vessel interaction wire: only the gev-trail: namespace receives the trail no-op', () => {
|
||||||
const harness = installWireHarness({ id: 'gev-trailing-contact' });
|
const harness = installWireHarness({ id: 'gev-trailing-contact' });
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -462,7 +462,7 @@ test('a ride handed to an aircraft on a layer Contacts turned on keeps that laye
|
|||||||
assert.deepEqual(on(manager), ['flights', 'military']);
|
assert.deepEqual(on(manager), ['flights', 'military']);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('a bridge ride keeps Live AIS Vessels when Contacts had turned it on', async (t) => {
|
test('Live AIS Vessels, once adopted as the ridden layer, outlives Contacts', async (t) => {
|
||||||
const live = await liveFixture(t, {
|
const live = await liveFixture(t, {
|
||||||
tracked: { layerId: 'flights', info: CIVIL },
|
tracked: { layerId: 'flights', info: CIVIL },
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user