Report actual speech playback state
Build and publish frontend / publish (push) Successful in 41s

This commit is contained in:
Ein Anderssono
2026-10-16 00:55:32 +02:00
parent 557fc77a52
commit ea7e349fc2
5 changed files with 33 additions and 3 deletions
+13
View File
@@ -130,6 +130,17 @@ test('TTS selects Swedish fallback, applies rate, and cancellation invalidates c
assert.equal(h.controller.getState(), 'IDLE');
});
test('speech is reported as in progress only after the native onstart event', () => {
const h = makeHarness();
h.controller.speak('Hej.');
assert.equal(h.controller.getState(), 'QUEUED');
assert.match(h.states.at(-1).message, /Startar uppläsningen/);
h.utterances[0].onstart();
assert.equal(h.controller.getState(), 'SPEAKING');
assert.match(h.states.at(-1).message, /Uppläsningen har startat/);
assert.match(h.states.at(-1).message, /iPadens volym/);
});
test('iOS user gesture primes speech silently and idle speech is not cancelled before speak', () => {
const h = makeHarness();
assert.equal(h.controller.activateFromUserGesture(), true);
@@ -202,6 +213,8 @@ test('TTS and microphone are mutually exclusive', () => {
h.controller.startListening();
h.controller.speak('Svar');
assert.equal(h.recognitions[0].aborted, true);
assert.equal(h.controller.getState(), 'QUEUED');
h.utterances[0].onstart();
assert.equal(h.controller.getState(), 'SPEAKING');
});