fix(cockpit): voice refuses entry while on a vessel bridge

Voice entry tracked an aircraft first, which cleared the vessel selection
and ended the bridge, and then failed because Cockpit was still active:
no bridge, no cockpit, no selected ship, and voice said entry was
unavailable. It now refuses before it touches tracking and says to exit
the bridge first.
This commit is contained in:
Sameh Khamis committed 2026-11-08 14:09:17 -08:00
1 parent b98bc4b0dc
commit 36a2216528
2 files changed
+25

No files matched your search

+21
View File
@@ -199,6 +199,27 @@ test('with no aircraft layer on, entry is refused for that reason, never for Con
assert.equal(cockpit.active, false);
});
test('voice entry on a vessel bridge refuses before it touches tracking', (t) => {
const { coordinator, cockpit } = fixture(t, { enabled: ['flights'] });
let navigated = false;
coordinator.services.militaryAwarenessLayer.navigateNext = () => {
navigated = true;
return true;
};
// Stand in for a bridge ride: the refusal reads only these two.
cockpit.active = true;
cockpit.subjectKind = 'vessel';
t.after(() => {
cockpit.active = false;
cockpit.subjectKind = null;
});
const voice = coordinator.controlCockpit('enter', { targetLayer: 'flights' });
assert.equal(voice.ok, false);
assert.match(voice.error, /vessel bridge/);
assert.equal(navigated, false, 'no aircraft was tracked');
assert.equal(cockpit.subjectKind, 'vessel');
});
test('with an aircraft layer on but nothing tracked, the reason is the missing aircraft', (t) => {
const { coordinator } = fixture(t, { enabled: ['military'] });
assert.equal(