From 0ba7ba651212cf5d95d130170cba494bb8577cac Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Sun, 8 Nov 2026 13:31:25 -0800 Subject: [PATCH] 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. --- src/data/aisLiveVessels.test.mjs | 16 ++++++++++++++++ src/ui/cockpitEntryGate.test.mjs | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/data/aisLiveVessels.test.mjs b/src/data/aisLiveVessels.test.mjs index 8e12bff94..6cae48234 100644 --- a/src/data/aisLiveVessels.test.mjs +++ b/src/data/aisLiveVessels.test.mjs @@ -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', () => { const harness = installWireHarness({ id: 'gev-trailing-contact' }); try { diff --git a/src/ui/cockpitEntryGate.test.mjs b/src/ui/cockpitEntryGate.test.mjs index adf3d916d..81c8ccf40 100644 --- a/src/ui/cockpitEntryGate.test.mjs +++ b/src/ui/cockpitEntryGate.test.mjs @@ -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']); }); -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, { tracked: { layerId: 'flights', info: CIVIL }, });