WIP read aloud keeps playing across chats
This commit is contained in:
@@ -143,6 +143,29 @@ void main() {
|
||||
expect(speech.state, SpeechState.idle);
|
||||
});
|
||||
|
||||
testWidgets('reading names the conversation until the reply ends', (
|
||||
tester,
|
||||
) async {
|
||||
reader();
|
||||
await speech.read(speechMessageId('chat-1', 'm1'), ['Hi'], title: 'One');
|
||||
expect(
|
||||
speech.reading.value,
|
||||
const SpeechReading(scope: 'chat-1', title: 'One'),
|
||||
);
|
||||
speech.retitle('chat-2', 'Other');
|
||||
expect(speech.reading.value?.title, 'One');
|
||||
speech.retitle('chat-1', 'Renamed');
|
||||
expect(speech.reading.value?.title, 'Renamed');
|
||||
|
||||
// Another reply replaces it; finishing clears it.
|
||||
await speech.read(speechMessageId('chat-2', 'm1'), ['Yo'], title: 'Two');
|
||||
expect(speech.reading.value?.scope, 'chat-2');
|
||||
engine.onStart!();
|
||||
engine.onCompletion!();
|
||||
expect(speech.reading.value, isNull);
|
||||
expect(speech.state, SpeechState.idle);
|
||||
});
|
||||
|
||||
testWidgets('voice and rate are applied and persist across a reload', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user