feat(video_calls): continous ringing on a defferent device fix

This commit is contained in:
misha
2026-10-21 14:25:59 +03:00
parent a6b94f835c
commit 141cf5543d
26 changed files with 871 additions and 93 deletions

View File

@@ -52,6 +52,7 @@ void main() {
videoCallRepository: mockRepository,
foregroundCoordinator: foreground,
lifecycleBinding: lifecycleBinding,
resolveHwId: () async => 'test-hw-id-android-01',
);
mockRoom = MockRoom();
when(mockRoom.connectionState).thenReturn(lk.ConnectionState.connected);
@@ -94,6 +95,13 @@ void main() {
await manager.declineIncomingCall('test-uuid');
verifyNever(mockRepository.notifyCallEnded(any));
verifyNever(
mockRepository.notifyCallDeclined(
conversationUuid: anyNamed('conversationUuid'),
hwId: anyNamed('hwId'),
callId: anyNamed('callId'),
),
);
},
);
@@ -112,15 +120,34 @@ void main() {
);
test(
'decline of a call that was never joined notifies the backend',
'decline of a call that was never joined notifies the backend via /decline',
() async {
when(
mockRepository.notifyCallEnded(any),
).thenAnswer((_) async => const VideoCallEndedResponse(sent: true));
mockRepository.notifyCallDeclined(
conversationUuid: anyNamed('conversationUuid'),
hwId: anyNamed('hwId'),
callId: anyNamed('callId'),
),
).thenAnswer(
(_) async => const VideoCallDeclineResponse(
sent: true,
devicesNotified: 1,
),
);
await manager.declineIncomingCall('other-uuid');
await manager.declineIncomingCall(
'other-uuid',
callId: 'call-uuid-1',
);
verify(mockRepository.notifyCallEnded('other-uuid')).called(1);
verify(
mockRepository.notifyCallDeclined(
conversationUuid: 'other-uuid',
hwId: 'test-hw-id-android-01',
callId: 'call-uuid-1',
),
).called(1);
verifyNever(mockRepository.notifyCallEnded(any));
},
);