diff --git a/__tests__/alarmSocket.test.ts b/__tests__/alarmSocket.test.ts index 65113be..72f1dee 100644 --- a/__tests__/alarmSocket.test.ts +++ b/__tests__/alarmSocket.test.ts @@ -88,7 +88,6 @@ describe('frame contract', () => { action: 'trigger', message: 'Fire drill', serverTime: '2026-10-18T17:00:00Z', - autoStopSeconds: 60, }); expect(parseFrame(raw)).toEqual({ type: 'alarm', @@ -97,10 +96,25 @@ describe('frame contract', () => { action: 'trigger', message: 'Fire drill', serverTime: '2026-10-18T17:00:00Z', - autoStopSeconds: 60, }); }); + it('ignores a legacy autoStopSeconds field instead of carrying it forward', () => { + // The service no longer sends it; a stale sender must not resurrect the + // "alarm expires on a timer" behaviour in any consumer. + const frame = parseFrame( + JSON.stringify({ + type: 'alarm', + alertId: 'a', + eventId: 'e', + action: 'trigger', + autoStopSeconds: 60, + }), + ); + expect(frame.type).toBe('alarm'); + expect(frame).not.toHaveProperty('autoStopSeconds'); + }); + it('parses a disarm frame', () => { const frame = parseFrame( JSON.stringify({ type: 'alarm', alertId: 'a', eventId: 'e', action: 'disarm' }),