feat(video_calls): ios calle mic fix, infinite loading after accepting call on an oppened app fix, incaming call declining after declining on a different device

This commit is contained in:
misha
2026-10-22 14:56:15 +03:00
parent 992573aead
commit d8d7a211bd
24 changed files with 924 additions and 142 deletions

View File

@@ -1027,6 +1027,42 @@ void main() {
await reconnectController.close();
},
);
test('video-call-declined closes the call on this device', () async {
final declined = StreamController<ChannelReadEvent>.broadcast();
when(mockWsManager.newMessagesStream).thenReturn(null);
when(mockWsManager.reconnected).thenAnswer((_) => const Stream.empty());
when(
mockWsManager.videoCallDeclinedStream,
).thenAnswer((_) => declined.stream);
when(mockWsManager.videoCallEndedStream).thenReturn(null);
final dismissed = <String?>[];
final ended = <String?>[];
chatsCubit.dismissIncomingVideoCall = (uuid) async {
dismissed.add(uuid);
};
chatsCubit.endActiveVideoCall = ({conversationUuid, callId}) async {
ended.add(conversationUuid);
expect(callId, 'call-1');
};
await chatsCubit.connectToWebSocket();
declined.add(
_FakeChannelReadEvent(
jsonEncode(<String, dynamic>{
'call_id': 'call-1',
'conversation_uuid': 'conv-1',
'status': 'declined',
}),
),
);
await Future<void>.delayed(Duration.zero);
expect(dismissed, ['conv-1']);
expect(ended, ['conv-1']);
await declined.close();
});
});
}