Files
life-echo/app-expo/tests/features/voice/tts-playback-gate.test.ts

15 lines
466 B
TypeScript

import { createTtsPlaybackGate } from '@/features/voice/tts-playback-gate';
describe('createTtsPlaybackGate', () => {
test('accepts TTS until interrupt, then drops until user sends', () => {
const gate = createTtsPlaybackGate();
expect(gate.shouldAcceptIncomingTts()).toBe(true);
gate.interrupt();
expect(gate.shouldAcceptIncomingTts()).toBe(false);
gate.onUserMessageSent();
expect(gate.shouldAcceptIncomingTts()).toBe(true);
});
});